Inserting to Access Database
- From: "MA P" <mark@xxxxxxxxxxx>
- Date: Mon, 4 Sep 2006 09:12:33 +0800
Hi!
Need help. I want to insert values from textbox-based input and upon
clicking the Create button, these command lines will run. It didn't work! It
points to the "test.Insert()" line that indicates that "Keyword not
supported: 'provider'". See the code behind below:
Protected Sub btnCreate_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnCreate.Click
Dim test As SqlDataSource = New SqlDataSource()
test.ConnectionString =
ConfigurationManager.ConnectionStrings("dbaccountsCS").ToString
test.InsertCommand = "INSERT INTO [tblaccounts] ([UserName],
[FName], [LName], [Email], [Department],[Password]) VALUES (@UserName,
@FName, @LName, @Email, @Dept, @Password)"
test.InsertParameters.Add("UserName", txtUserName.Text)
test.InsertParameters.Add("FName", txtFName.Text)
test.InsertParameters.Add("LName", txtLName.Text)
test.InsertParameters.Add("Email", txtEmail.Text)
test.InsertParameters.Add("Dept", ddlDept.Text)
test.InsertParameters.Add("Password", txtPass.Text)
test.Insert() <<<<<<<<------ This line has an error
Label7.Visible = True
End Sub
.
- Prev by Date: Re: IsNumeric
- Next by Date: Re: IsNumeric
- Previous by thread: Is asp.net database design different to ado and access?
- Next by thread: Re: Inserting to Access Database
- Index(es):