473,320 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DATE Time

Sir,

I had 3 dropdown list box ,it can have day,month,year respectively and I stored values in it while design time itself,after store in database now I want to edit that date, how is it possible, I tried the below coding but it is not working. Pls help me sir.

Expand|Select|Wrap|Line Numbers
  1. protected void Editinward_Click(object sender, EventArgs e)
  2.     {
  3.         int a;
  4.         Session["inward"] = "j";
  5.         foreach (GridViewRow row in inwardgrid.Rows)
  6.         {
  7.             CheckBox chk = (CheckBox)row.FindControl("cb1");
  8.             if (chk.Checked)
  9.             {
  10.                 HiddenField hf11 = (HiddenField)row.FindControl("hf1");
  11.                 Session["inward"] = hf11.Value;
  12.                 Label lb1 = (Label)row.FindControl("lbmaterial");
  13.                 Label lb2 = (Label)row.FindControl("ldate");
  14.                 Label lb3 = (Label)row.FindControl("lbsuppliername");
  15.                 Label lb4 = (Label)row.FindControl("lbdcno");
  16.                 Label lb5 = (Label)row.FindControl("lbqty");
  17.                 DateTime d;
  18.                 d = Convert.ToDateTime(lb2.Text);
  19.  
  20.                 ddlday.SelectedItem.Value   = d.Day.ToString();
  21.                 ddlmonth.SelectedItem.Value  = d.Month.ToString();
  22.                 ddlyear.SelectedItem.Value  = d.Year.ToString();
  23.  
  24.  
  25.                 txtmaterial.Text = lb1.Text;
  26.                 txtsuppliername.Text = lb3.Text;
  27.                 txtdcno.Text = lb4.Text;
  28.                 txtqty.Text = lb5.Text;
  29.             }
  30.         }
  31.     }
Oct 31 '08 #1
1 994
r035198x
13,262 8TB
How is it not working? What happens when you try to run the code?
Oct 31 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
15
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract...
13
by: maflatoun | last post by:
Hi, I have the following function to convert UTC time to Local time. It works perfect for GMT- (Minus) time zones however it provides incorrect results for GMT+(Plus) time zones? // Format to...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
3
by: colleen1980 | last post by:
Hi: Data in my table is in that format. How to i separate date with time. 11/9/2006 10:10:46 AM Thank You.
6
by: Geoff Cox | last post by:
Hello, at the moment I can add the combined date and time into MySQL using php $dt1 = date("Y-m-d H:i:s"); is it possible to add the date and time separately? I thought it might be
0
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
4
by: ahmurad | last post by:
Dear Brothers, I am struggling the following four Date-Time type values which were inputted into MYSQL database in different tables. As MYSQL Default Time Format: YYYY-MM-DD HH:MM:SS, So I used...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.