Hi all
Complete newby trying to understand something
I have made my own form with some fields and then dragged a SqlDataSource
onto the page and made an Insert to go with the SqlDataSource.
I have a button which calls this
Protected Sub InsertTextBox_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles InsertTextBox.Click
Me.SqlDataSource1.InsertParameters.Add("@CompanyID",
Me.CompanyIDTextBox.Text)
Me.SqlDataSource1.InsertParameters.Add("@ContactName",
Me.ContactNameTextBox.Text)
Me.SqlDataSource1.InsertParameters.Add("@CompanyName",
Me.CompanyNameTextBox.Text)
Me.SqlDataSource1.InsertParameters.Add("@Postcode", Me.PostCodeTextBox.Text)
Try
Me.SqlDataSource1.Insert()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
I have checked parameter names etc put it wont put the values to the
parameters. Obviously the .Add is wrong, what should be using?
Cheers
|