|
Why don't you test the query in query analyzer before implementing it ?
|
|
|
|
|
thank you,
i used query analyzer but the result that be shown was all of books.
select * from mytable where date>1/1/2008
Hoda
modified on Thursday, May 22, 2008 11:06 AM
|
|
|
|
|
CheckBoxList cbl = (CheckBoxList)sender;
if (cbl.Items[0].Selected && cbl.SelectedIndex.Equals(0))
{
for (int items = 1; items < cbl.Items.Count; items++)
{
if (!cbl.Items[items].Selected)
cbl.Items[items].Selected = true;
}
}
else if (!cbl.Items[0].Selected && cbl.SelectedIndex.Equals(1))
{
for (int items = 1; items < cbl.Items.Count; items++)
{
if (cbl.Items[items].Selected)
cbl.Items[items].Selected = false;
}
}
I use this above code to check all items in a CheckBoxList. But if all checkboxes are check and I uncheck some the SelectedValue = 0 of the CheckBoxList. In that case it wil check all checkboxes again. How to prevent this?
|
|
|
|
|
I understand your problem.
Since you don't get any information about which of the items was checked/unchecked this won't work.
The best way to do it, is to make one item that does the (un)checking. For example
<asp:CheckBox ID="checkall" runat="server" AutoPostBack="true" Text="(un)check all"
OnCheckedChanged="checkall_CheckedChanged" />
<asp:CheckBoxList ID="listCheck" runat="server" AutoPostBack="true" OnSelectedIndexChanged="listCheck_SelectedIndexChanged">
<asp:ListItem Text="Main1"></asp:ListItem>
<asp:ListItem Text="Main2"></asp:ListItem>
<asp:ListItem Text="Main3"></asp:ListItem>
<asp:ListItem Text="Main4"></asp:ListItem>
<asp:ListItem Text="Main5"></asp:ListItem>
</asp:CheckBoxList>
private bool overrideEvent;
protected void listCheck_SelectedIndexChanged(object sender, EventArgs e)
{
overrideEvent= true;
checkall.Checked = false;
}
protected void checkall_CheckedChanged(object sender, EventArgs e)
{
if (overrideEvent)
return;
for (int items = 0; items < listCheck.Items.Count; items++)
listCheck.Items[items].Selected = checkall.Checked;
}
Notice the use of the boolean, if I manually set the Checked of the checkall item, I don't want the checklist to change, so that's why i use the boolean.
|
|
|
|
|
i want to access other PC Screen like Teamviewer in asp.net
|
|
|
|
|
You cannot do that with ASP.NET. You need to write an app to do it, a java plug in can do it via the web, that's how gotomeeting works, for instance.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I Want to do paging in HTML tables.And i want to show 5 cell in a row.my code perfectly running with one cell in one row and i am unable to show 5 cell in a row.Can any body tell me where i am wrong?
|
|
|
|
|
Your code is broken. We need to see the code to tell you more
A GridView will create tables with any page size you like from a dataset.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi everybody,
I've made a winapp that displays items in a storage. Each of these items is implemented as a control and is added as childcontrols to a parent, a StorageControl. With this design I can have click events for each item etc.
Now I want to convert this winapp into a webapp and have thought about implementing it in a similar way. I can make a "StorageControl", that is renderd as a DIV-tag with a specified width and height. I can also add items as childcontrols to this StorageControl. But how can I specify these items position in the DIV as X,Y-coordinates?
Is it possible at all?
Or is there any other smart solutions to my problem? A clickable imagemap?
Thanks...
|
|
|
|
|
Hello,
I have a gridview with checkboxes(inside Gridview) and a Button contol(outside of Gridview)with BtnDeleteSelected
My aim is to get the value of 1st row 2nd column in gridview(1st Column is CheckBox control) and 2nd column is pid value.I want 'Pid' Value
i wrote this code
int pID = Convert.ToInt32(gv.DataKeys[row.RowIndex].Value);
it is showing this error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Pinna
modified on Thursday, May 22, 2008 9:15 AM
|
|
|
|
|
haripinna wrote: GridViewRow row = gv.Rows[i];
CheckBox chkbox = (CheckBox)row.FindControl("chkSelect")
Oh what code have u posted. I can`t get head or tails out of it..Pls post the entire code so that we can understand your logic implementation.
|
|
|
|
|
Hello,
Thanks for your response.
I got answer for that question..
now my problem is
I have a gridview with checkboxes(inside Gridview) and a Button control(outside of Gridview)with BtnDeleteSelected
My aim is to get the value of 1st row 2nd column of gridview(1st Column is CheckBox control) and 2nd column is pid value.I want 'Pid' Value
i wrote this code
for(i=0;i<gv.rows.count;i++)>
{
GridViewRow row = gv.Rows[i];
CheckBox chkbox = (CheckBox)row.FindControl("chkSelect")
if(chkbox.checked)
{
int pID = Convert.ToInt32(gv.DataKeys[row.RowIndex].Value);
}
}</gv.rows.count;i++)>
it is showing this error
Index was out of range. Must be non-negative and less than the size of the collection.<br />
Parameter name: index
Pinna
|
|
|
|
|
Try this
string strContactId = "" + gvContacts.SelectedDataKey["ContactId"];
or
string strContactId = "" + gvContacts.SelectedValue;
You have to write these Code in OnSelectedIndexChanged event of gridview.Initially you have to set Datakeynames="ContactId" in gridview property.
i hope it wil work for u
|
|
|
|
|
|
at the moment you are only finding the checkbox
Wheres the code which should be setting the checkbox to true or false
Can you explain a bit more?
|
|
|
|
|
Hey all,
Weird one...
I have a Nav bar at the top of my shop page, it is dynamically created from a dB (new Hyperlink control for each link)
This has always worked fine, until I add a 5th link, like I have at the moment. see http://www.brora.co.uk - the Sale Hyperlink.
If you are using IE6 not sure about below, don't have a copies of these, when you click the 'Sale' Link, it loads the page, then 'chops off' the content from below that. When you click it again it all works just fine.
It only happens on this link, as it is dynamicaly created it has the same settings as the others.
Has anyone else ever had a problem like this? if so do you have a solution?
Any help would be apprecited ASAP as this is a live site!
Mark
|
|
|
|
|
Ok, well I suspected it was css issues and it was, still aweird one though...
|
|
|
|
|
Hi,
I embed flash(.swf)file in my .aspx page. Its working good in Firefox,Opera and safari.
But i browse in IE it's not working that means it's loading continuously but no images
displayed.This is my code
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">
id="MyMovie">
<param value="mDirectCP.swf" />
<embed src="mDirectCP.swf" width="630px" height="500px" />
I hope ur's reply.
Thanks
Every Successful Person Have A Painful Story
|
|
|
|
|
Hi,
I need a software in .Net which can transfer data of credit card swipe machine to the software.
Thanks,
Mini
|
|
|
|
|
I would start by visiting google and looking there
www.google.co.uk
|
|
|
|
|
This has nothing to do with ASP.NET. The software you want, would have to come with the swipe machine.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i wanna hide the close button in my popup window without fullscreen
im using code like that but it doesn't work
Hyberlink1.Attributes.Add("OnClick", "window.open('Edit_Session.aspx',null, 'titlebar=no,menubar= no');");
|
|
|
|
|
You cant disable this button
However try:
window.open('Page.aspx', '', 'Fullscreen=yes');
This will open it full screen so that the close and minimize buttons will be hidden
|
|
|
|
|
Hello Friends
How Can i dynamic add item in context menu and open Context Menu ( of telerik component ) on Grid row click through javascript .
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Hi,
Im using Webservice to implement autocomlpeteextender but im getting the folling error..any namespace i need to add or any changes have to do in the web config? im struggling? im getting the folling error..
Error 1 Attribute 'System.Web.Script.Services.ScriptService' is not valid on this declaration type. It is valid on 'class, interface' declarations only.
Here the following code which i have used...
=================================
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data;
using System.Data.SqlClient;
/// <summary>
/// Summary description for Auto
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Auto : System.Web.Services.WebService {
public Auto () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[System.Web.Script.Services.ScriptMethod]
[System.Web.Script.Services.ScriptService]
[WebMethod]
public string[] GetCountryInfo(string prefixText)
{
SqlConnection con = new SqlConnection("uid=srp;pwd=12345;server=kagserver;");
//int count = 10;
string sql = "select * from student_information Where s_Name like @prefixText";
SqlDataAdapter da = new SqlDataAdapter(sql, con);
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = prefixText + "%";
DataTable dt = new DataTable();
da.Fill(dt);
string[] items = new string[dt.Rows.Count];
int i = 0;
foreach (DataRow dr in dt.Rows)
{
items.SetValue(dr["s_Name"].ToString(), i);
i++;
}
return items;
}
}
=============================
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Autocomplete.aspx.cs" Inherits="Autocomplete" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/Auto.asmx" />
</Services>
</asp:ScriptManager>
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" TargetControlID="TextBox1" MinimumPrefixLength="1"
ServicePath="Auto.asmx" ServiceMethod="GetCountryInfo" EnableCaching="true" CompletionInterval="200"
runat="server">
</cc1:AutoCompleteExtender>
</div>
<div class="buttonwrapper">
<a class="squarebutton" href="#"><span>Submit</span></a> <a class="squarebutton"
href="#" style="margin-left: 6px"><span>Reset</span></a>
</div>
</form>
</body>
</html>
Rgrds
Kanna
|
|
|
|