Re: Insert Data
- From: "Markis Taylor" <doeboylinux@xxxxxxxxx>
- Date: 17 Aug 2005 05:44:34 -0700
This is my function for executing UPDATE, INSERT and DELETE commands on
a database. You just supply the SQL statement and the connection
string and then execute the function.
Public Function ExecDB(ByVal ExecuteQuery As String, ByVal
ConnectionString As String) As Boolean
' This function takes in a execute statement and a database
connection
' string and will execute the statement on the database and
report true/false
' if it executed properly or not
Try
Dim oleConn As New OleDbConnection(ConnectionString)
Dim oleCmd As New OleDbCommand(ExecuteQuery, oleConn)
oleCmd.Connection.Open()
oleCmd.ExecuteNonQuery()
oleConn.Close()
oleCmd.Dispose()
Return True
Catch ex As Exception
MessageBox.Show("Database Error:" & Chr(10) & ex.Message)
Return False
End Try
End Function
.
- References:
- Insert Data
- From: Rafael Tejera
- Re: Insert Data
- From: Armin Zingler
- Insert Data
- Prev by Date: Re: HashTable gone nuts...
- Next by Date: Set column values in a DataTable all at once?
- Previous by thread: Re: Insert Data
- Next by thread: ProcessID and Thread ID Exceptions in framwork installed system
- Index(es):
Relevant Pages
|