"Joseph Hanna" <zo...@msdn.com> wrote in message news:Ox4TxfUM...@TK2MSFTNGP11.phx.gbl...
==============
'Retrieve the contents of the order into a DataTable.
Dim strConn, strSQL As String
strConn = "Provider=SQLOLEDB;Data Source=(local)\NetSDK;" & _
"Initial Catalog=Northwind;Trusted_Connection=Yes;"
strSQL = "SELECT OrderID, ProductID, Quantity, UnitPrice " & _
"FROM [Order Details] WHERE OrderID = 10503 " & _
"ORDER BY ProductID"
Dim da As New OleDbDataAdapter(strSQL, strConn)
Dim tbl As New DataTable("Order Details")
da.Fill(tbl)
'Modify the contents of the order.
tbl.Rows(0).Delete()
tbl.Rows(1)("Quantity") = CShort(tbl.Rows(1)("Quantity")) * 2
tbl.Rows.Add(New Object() {10503, 1, 24, 18})
'Submit the pending changes.
Try
da.Update(tbl)
Console.WriteLine("Successfully submitted new changes")
Catch ex As Exception
Console.WriteLine("Call to DataAdapter.Update " & _
"threw exception:" & vbCrLf & ex.Message)
End Try
==================
Sincerely,
Kevin
Microsoft Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security
--------------------
| From: "Joseph Hanna" <zo...@msdn.com>
| Subject: Access Database Updates
| Date: Fri, 13 Jun 2003 11:05:53 +1000
| Lines: 171
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_024C_01C3319B.C1632CE0"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <Ox4TxfUM...@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: cpe-144-132-177-28.nsw.bigpond.net.au 144.132.177.28
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:53361
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
--
Joe Hanna
Advanced Software Engineering
joe.hanna_AT_advancedsoftware_DOT_net_DOT_au
"Kevin Sun [MS]" <zhi...@onlinemicrosoft.com> wrote in message
news:$TZS1bYM...@cpmsftngxa06.phx.gbl...
I am now considering storing all dates as a Double data type. This will also provide me with enough
power to be database independant using the OleDb provider, as querying a table with a Date/Time
qualifier requires different syntax for different Db vendors.
Does anyone know of any issues with this?
--
Joe Hanna
Advanced Software Engineering
joe.hanna_AT_advancedsoftware_DOT_net_DOT_au
"Joseph Hanna" <zo...@msdn.com> wrote in message news:OCI7bDZM...@TK2MSFTNGP11.phx.gbl...
Ron Allen
"Joseph Hanna" <zo...@msdn.com> wrote in message
news:ObbP8C1M...@tk2msftngp13.phx.gbl...
I am using obsure names for the Date/Time fields that could not be mistaken for reserved words such
as EMP_START_DATE. All of my fields start with a 3 letter code describing the table.
Also, I am not using CommandBuilder, directly anyway.
I have set up a test case where I drag the table from the Server Explorer on to the Form Designer
and Generate a Dataset, add a Data Grid and bind it in the IDE. Form Load Fills the Data Adapter,
and a Button is added to do the Update. Make a change in the Data Grid and click the button -
DBConcurrencyException
--
Joe Hanna
Advanced Software Engineering
joe.hanna_AT_advancedsoftware_DOT_net_DOT_au
"Ron Allen" <ral...@src-us.com> wrote in message news:O%23lNDXA...@TK2MSFTNGP11.phx.gbl...
Ron Allen
"Joseph Hanna" <zo...@msdn.com> wrote in message
news:ufxk5MIN...@TK2MSFTNGP12.phx.gbl...
Once I removed the Date/Time fields from the tables all went ok. I have decided to convert the
Dates to Double before storing them. Sounds like a Hack but hey - it works and I cannot afford
anymore time mucking arounding trying to get it going.
Thanks for your time and effort.
Joe
--
Joe Hanna
Advanced Software Engineering
joe.hanna_AT_advancedsoftware_DOT_net_DOT_au
"Ron Allen" <ral...@src-us.com> wrote in message news:%23lmyHCN...@TK2MSFTNGP12.phx.gbl...
I have exactly the same problem has you have.
The reason is that the ACCESS oleDB provider truncates the TIME information
of a DATE/TIME field and preserves only the DATE. This mean that it is
unable to find back any modified records that contains a DATETIME field.
This is definetively a bug and I wonder why it has not been fixed yet as it
makes ADO.NET unusable with ACCESS databases.
-- Obe.
"Joseph Hanna" <zo...@msdn.com> wrote in message
news:%23$iSKwdND...@TK2MSFTNGP10.phx.gbl...