|
-
Oct 17th, 2002, 05:02 PM
#1
Thread Starter
Frenzied Member
Problem with datasets updating time fields
Hi ppl,
I am really tired of posting this problem here and there
without any solution for it.
In a simple VB.NET application i used an oledbdataadapter to connect to an access database containing of only one table with 2 fields, one auto number filed and one Date/Time field, and passed the data from a textbox to the database. No matter what time i insert to the text box, always 0:00 is stored in the
database. I use Jet4 SP6, DOTNETFX SP2, and ACCESS 2002
SP2,WinXP Pro and the database is in access 2002 format. I tried to test various Date/Time formats such as short time, long time, general date ...,and various change type CTYPE, CDATE... still no success. The code i used is :
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim dtrow As DataRow
dtrow = DataSet11.tb1.NewRow
dtrow(0) = CDate(TextBox1.Text)
DataSet11.tb1.Rows.Add(dtrow)
Ole1.Update(DataSet11.tb1)
End Sub
at dataset level everything is fine, that is if i populate
a datagrid from the dataset before updating the database
and refilling the dataset from it, its ok. I have found
out that if i change the automatically build insert
command and just put a value instead of the parameter it
will work fine, however when i check the parameter value
of the insertcommand it just has the value i passed to it
so the problem can not be the parameter itself. I dont
know what goes wrong with the transactions of the dataset
and the database in this situation.
Please help me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|