Re: inserting data problem with something having to be declared
From: Triptaz (Triptaz_at_discussions.microsoft.com)
Date: 03/19/05
- Previous message: Triptaz: "Re: inserting data problem with something having to be declared"
- In reply to: Triptaz: "Re: inserting data problem with something having to be declared"
- Next in thread: Triptaz: "Re: inserting data problem with something having to be declared"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 19 Mar 2005 09:37:04 -0800
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Dim MyConnection As SqlConnection
' MyConnection = New SqlConnection("server=TRIP\TRIP1;" _
' & "database=CustomerMain")
MyConnection = New SqlConnection("ES2")
Dim myCommand As SqlCommand
Dim insertcmd As String
'SQL INSERT statement string for all field values
this line is commented out
'insertcmd = "insert into Customer Info values ([Booth Numer],[First
name],[Last Name], Company, Address, City, Zip, Phone, Fax, Email);"
this is the line i am using
insertcmd = "insert into Customer Info Values ("&txtBooth&" ,
@txtFirst,@txtLast,@txtCompany,@txtAddress,@txtCity,@txtZip,@txtPhone,@txtFax,@txtEmail);'"
'SQL insert command for input fields
myCommand = New SqlCommand(insertcmd)
Still telling me that this "[Booth Number]" is not declared can someone tell
me what im doing wrong or what i am misssing. tried the solution that was
given to me and did not work [Booth Number] is a table in my database am i
writing it wrong or am i forgetting something. i have tried other tables in
the database and im still getting this error about it not being declared
myCommand.Parameters("@txtbooth").Value = [Booth Number].value
' mycommand.Parameters("@
"Triptaz" wrote:
> This did not work because it was telling me the the & was not a defines part
> of a string
>
> "Gérard Leclercq" wrote:
>
> > Sorry,
> > ('" & txtBooth & "','" & txtFirst & "','" & txtLast etc...
> >
> >
> >
- Previous message: Triptaz: "Re: inserting data problem with something having to be declared"
- In reply to: Triptaz: "Re: inserting data problem with something having to be declared"
- Next in thread: Triptaz: "Re: inserting data problem with something having to be declared"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|