visweswaran
New member
- Joined
- Jul 15, 2009
- Messages
- 1
- Programming Experience
- Beginner
which is used for executing create table query whether executenonquery() or anyother command plz telllllllllll
m_Connection = New OleDb.OleDbConnection(....)
Dim TheSql As String = "CREATE TABLE ....."
Try
m_Connection.Open()
Dim DataCommand As New OleDb.OleDbCommand
Dim myTrans As OleDb.OleDbTransaction
DataCommand.Connection = m_Connection
DataCommand.CommandText = TheSql
myTrans = m_Connection.BeginTransaction
DataCommand.Transaction = myTrans
DataCommand.ExecuteNonQuery()
myTrans.Commit()
'Was Successful
Catch ex As Exception
Throw New InvalidOperationException("Could not create the table" & Environment.NewLine & TheSql & Environment.NewLine & ex.ToString)
'Failed
Finally
m_Connection.Close()
End Try