PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
how to connect asp.net with MS-access and also how to pass data t
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
how to connect asp.net with MS-access and also how to pass data t
![]() |
how to connect asp.net with MS-access and also how to pass data t |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Jack,
About what you are asking is broad, but this website can give you a quickstart http://samples.gotdotnet.com/quickstart/ I hope this helps, Cor "Jack" <Jack@discussions.microsoft.com> schreef in bericht news:9A4FC764-034C-4C11-8E21-723A6F2779DF@microsoft.com... > 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 > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

