.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 19th, 2005, 12:19 PM
ajith ajith is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 ajith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 55 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > how to delete a table from MS ACCESS database from asp.net using VB.net


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap