Skip to main content

Posts

Showing posts from May, 2010

How to execute a query in Vb.net

strSQL="delete or insert or update * from tablename where condition" Try             cnSQL = New OleDbConnection(ConnectionString)             cnSQL.Open()             cmSQL = New OleDbCommand(strSQL, cnSQL)             cmSQL.ExecuteNonQuery()             drSQL.Close()             cnSQL.Close()             cmSQL.Dispose()             cnSQL.Dispose()         Catch Exp As OleDbException             MsgBox(Exp.Message, MsgBoxStyle.Critical, "Oledb Error")         Catch Exp As Exception             MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error") End Try