inserting data problem with something having to be declared
From: Triptaz (Triptaz_at_discussions.microsoft.com)
Date: 03/19/05
- Next message: Kevin Yu [MSFT]: "Re: Return all InfoMessages"
- Previous message: Dennis: "Re: Newbie SQL Queston on INSERT"
- Next in thread: Gérard Leclercq: "Re: inserting data problem with something having to be declared"
- Reply: Gérard Leclercq: "Re: inserting data problem with something having to be declared"
- Reply: Gérard Leclercq: "Re: inserting data problem with something having to be declared"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Mar 2005 21:45:01 -0800
i am trying to insert data from a form into a sql database. here is my code
that i have written so far:
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")
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 that i am trying to use
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)
this is the line that is giving me problems can someone tell me what i am
doing wrong
myCommand.Parameters("txtbooth").Value = Company.value
the COMPNAY value it tells me that it is not declared can someone tell me my
problem with this line of code
thanks would appreciate it newbie here
- Next message: Kevin Yu [MSFT]: "Re: Return all InfoMessages"
- Previous message: Dennis: "Re: Newbie SQL Queston on INSERT"
- Next in thread: Gérard Leclercq: "Re: inserting data problem with something having to be declared"
- Reply: Gérard Leclercq: "Re: inserting data problem with something having to be declared"
- Reply: Gérard Leclercq: "Re: inserting data problem with something having to be declared"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|