you cn try using Convert.ToDateTime() method also. On Mon, Dec 5, 2011 at 7:06 PM, Cerebrus <[email protected]> wrote: > In actuality, you are not doing any conversion, but a datetime string > is being parsed into a DateTime object. This parsing is dependent upon > a no. of factors, significant among which is the current thread's > culture settings. > > Since the datetime string you are using is in the "mm/dd/yyyy > hh:mm:ss" format, it appears that your current system culture is set > to something other than this default. > > Try setting the culture explicitly or parse the datetime manually by > providing the format I described above. Then it will be easily set as > a parameter value. > > On Dec 3, 11:46 am, Ganesh S <[email protected]> wrote: >> I have load Date only(12/31/2011) in txtDateFrom from a datepicker. >> >> I have select Time from Two dropdown 1 for Hour and one for Mins. >> >> Now i need to pass these date and Time as a single parameter to a >> stored procedure ok. >> >> So before i pass this parameter i need to join the date and time as a >> single value, >> >> so First i joined the two dropdown values like, >> >> String time=ddlHour.selectedItem.tostring() >> +":"+ddlHour.selectedItem.tostring() >> >> txtDate.text = txtDate+" " +time; >> >> Now i have the date and time in the textbox like 12/31/2011 01:02:00 >> >> Now i send the value of the textbox to a parameter that was created in >> a stored proc(dateTime). >> >> Here i am getting error when i convert this textbox value to datetime. > > -- > You received this message because you are subscribed to the Google > Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML > Web Services,.NET Remoting" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en > or visit the group website at http://megasolutions.net
-- Regards, Praneet Rastogi 9307880585 -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net
