| || ||Thread Tools||Search this Thread|
|22nd May 2008, 09:41||#1|
Senior - BHPian
Join Date: Dec 2007
Thanked: 216 Times
Clarification on .NET (VB 2005 Express edition)
I am trying to create a program to insert / update records in MS Access DB. I tried to check the MSDN, forums and somehow getting there. It looks so easy, but tough. I get strange error when I execute the connection.open command :(
The error I get is
"A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll"
Below is the function.
Public Sub InsertRow(ByVal connectionString As String, _
ByVal insertSQL As String)
Using connection As New OleDbConnection(connectionString)
' The insertSQL string contains a SQL statement that
' inserts a new row in the source table.
Dim command As New OleDbCommand(insertSQL)
' Set the Connection to the new OleDbConnection.
command.Connection = connection
' Open the connection and execute the insert command.
Catch ex As Exception
' The connection is automatically closed when the
' code exits the Using block.
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Wireless net for Laptop||carboy||Gadgets, Computers & Software||14||19th October 2007 17:00|
|advice me AI NET||gbpscars||In-Car Entertainment||8||30th July 2006 01:05|
|Which is best way to connect 2 net through cell phone||hari_rama||Gadgets, Computers & Software||14||24th March 2006 16:16|