Click here to Skip to main content
15,901,001 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please please help me ...


I want to load load the saved date & time to the date & time textbox again .

but whenever i do this i get errors however i am able to save the date & time ...

Please help me

...
this is how i am trying to load the date & time from the table ..


txtdate.Text = Convert.ToString(objDTTabCustDtl.Rows[0].ItemArray[25]);

please help me .. thanks in advance ...
Posted
Comments
BillWoodruff 23-Oct-11 3:25am    
Is this WinForms or ?

If WinForms : exactly what is the 'txtdate' control is: is it a MaskedEditTextBox whose Mask is set to display dates in a certain format ?

I think showing a sample of the text generated by the call to the DataBase would also help you get an answer here.

1 solution

Without seeing your error message, and with limited knowledge of you database, it is difficult to tell.
What I would do is pick the line apart, and use the debugger to single step through each stage:
C#
DataRow dr = objDTTabCustDtl.Rows[0];
object o = dr.ItemArray[25];
string s = Convert.ToString(o);
At each stage, see what you have, and try to work out what the next stage should produce before you move through it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900