|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to delete a table from MS ACCESS database from asp.net using VB.net
Hi All,
I am trying to develop a web application in asp.net where my database is in MS ACCESS. Dim conn As OleDbConnection Dim mycommand As OleDbCommand Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\CBPCleanData\Result File\" & tname conn = New OleDbConnection(connString) conn.Open() mycommand = New OleDbCommand("delete * from cbp_prest2", conn) mycommand.ExecuteNonQuery() mycommand.CommandText = "delete * from cbp_prest3" mycommand.ExecuteNonQuery() mycommand.CommandText = "delete * from cbp_prest4" mycommand.ExecuteNonQuery() mycommand.CommandText = ("delete * from cbp_prest4_sic") mycommand.ExecuteNonQuery() when I used the above code I am getting the following error. : Could not delete from specified tables. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Could not delete from specified tables. Source Error: Line 12: Line 13: mycommand = New OleDbCommand("delete * from cbp_prest2", conn) Line 14: mycommand.ExecuteNonQuery() Line 15: mycommand.CommandText = "delete * from cbp_prest3" Line 16: mycommand.ExecuteNonQuery() Source File: c:\inetpub\wwwroot\CBPApplication\WebForm1.aspx.vb Line: 14 I am new to .net programming. Can anyone help me to overcome this problem. Thanks |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > how to delete a table from MS ACCESS database from asp.net using VB.net |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|