Re: insert time in vb.net
This one ?
Code:
cmd.Parameters.AddWithValue("@ending_out", Convert.ToDateTime(ListView1.Items(i).SubItems(6).Text).ToShortTimeString())
Re: insert time in vb.net
i used that and in the date part 1900-01-01 was inserted..still i m getting date part...
Re: insert time in vb.net
SQL Server columns cannot contain the time alone. That's why the column data type is 'datetime': it contains a date and a time. You simply have to ignore the date part when you read the data.
Re: insert time in vb.net
What is Your BackEnd. ? If it is SQL Server You cannot insert only time in if the Column type id DateTime or SmallDateTime. The other thing you can do is the change the column definition to varchar or char datatypes..
Edit: Little slow in typing :)
Re: insert time in vb.net
i was thinking abt doing that but if i change datetime to varchar then would i be able to perform the time functions like adding time and all regarding that varchar text that i insert..
Re: insert time in vb.net
Then you have to neglect the Datepart while reading the values in your front end
Re: insert time in vb.net
that's what i want to do.........if i insert both datetime then how can i extract only time part into textbox....
Re: insert time in vb.net
Quote:
Originally Posted by
anirai
that's what i want to do.........if i insert both datetime then how can i extract only time part into textbox....
You've already asked that question in another thread and I've already provided an answer. I've asked you to post your current code and you have yet to do so. Please don't start asking the same question in multiple threads.
Re: insert time in vb.net
oki....c ya in another thread