Click here to Skip to main content
15,888,351 members

Comments by praveengb (Top 4 by date)

praveengb 12-Oct-11 2:36am View    
hello Sir,

I want to store the Attended date n time in the database.. I have the 2 separate columns for date n time as nvarchar in the table urbrur.


I have a one gridview in that i have 2columns and one checkbox one is for compno n other for status where the value of status is either Attended or Under Process..

now i'm displaying only under process complaints n on checking of the respective check box the status of the compno is updated as Attended in the database table called urbrur..but now i want to store the current date n time as well in the urbrur as at what date n time that respective copmno is get Attended . .

So how should i display the current date n time in the existing gridview and on checking of that particular check box that date n time also should be get stored in the table urbrur[here i have 2separate columns for date and time as nvarchar]


So kindly plz suggest me to how i do make it . .'m very much indeed needed.



Thx,
praveen
praveengb 4-Oct-11 7:25am View    
thank you sir.. I got the result with this query . . but sir, I'm unable to display it in the grid view i.e,

protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
if (Page.IsPostBack)
{

if (Menu1.SelectedItem.Text == "A")
{

string _query2 = " select compno,name,address,phoneno,complaint,compdate,comptime,contactno,status from urbrur where cat1='" + Menu1.SelectedItem.Text + "' and status='Under Process' and DATEADD(hh,6,cast(compdate + ' ' + comptime as datetime))<=GETDATE()";
comd = new SqlCommand(_query2, cn);
sqlda = new SqlDataAdapter(comd);
ds = new DataSet();
sqlda.Fill(ds, "urbrur");
GridView1.DataSource = ds;
GridView1.DataMember = "urbrur";
GridView1.DataBind();
cn.Close();


}




}
}
When i click on the that menu button . . the plane grid is displaying without any data..here I'm not using default grid columns.. in the grid i created 9 columns as BoundField with one checkbox field total 10 columns.. so plz suggest me what to do..
praveengb 22-Sep-11 1:31am View    
but friend whats that @time, I don't have any column or variable declared by this name....
praveengb 21-Sep-11 8:23am View    
I'm inserting it as TextBox34.Text.ToString()in the insert query