Re: inserting data problem with something having to be declared
From: Triptaz (Triptaz_at_discussions.microsoft.com)
Date: 03/19/05
- Next message: SP: "Re: How to insert to MS SQL from vb .net"
- 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"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 19 Mar 2005 09:37:08 -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
'insertcmd = "insert into Customer Info values ([Booth Numer],[First
name],[Last Name], Company, Address, City, Zip, Phone, Fax, Email);"
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)
i am having troulbe getting the [Booth number] declared does anyone know
what i am doing wrong tried the correction and it did not work
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...
> >
> >
> >
- Next message: SP: "Re: How to insert to MS SQL from vb .net"
- 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"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|