how to connect asp.net with MS-access and also how to pass data t

G

Guest

hI,

Anyone here know how to connect asp.net with MS-access and also how to pass
data to a table?

The following is the code which I have but unfortunately its not working..
Public Connectionstring As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source =
C:\Inetpub\wwwroot\Dee\ASPdotnet\currt.mdb;Persist Security Info=False;"
Public con As New OleDbConnection(Connectionstring)


Dim strSelect As String
strSelect = "Insert Into UserDetails1 (Username) Values
(@DetailsUser)"
Dim cmd As New OleDbCommand(strSelect, con)
Dim added As Integer
cmd.Parameters.Add("@DetailsUser", txtUserDetails.Text)

Try
con.Open()
cmd.ExecuteNonQuery()
Response.Write("Updated Successfully!<p> </p><p> </p><p> </p>")

con.Close()
Response.Write("Updated Successfully!<p> </p><p> </p><p> </p>")
Catch
con.Close()
End Try



Thanks in advance
Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top