Click here to Skip to main content
15,917,454 members
Home / Discussions / C#
   

C#

 
GeneralWeb Service shared class definition Pin
chilberto9-Jun-05 0:53
chilberto9-Jun-05 0:53 
GeneralRe: Web Service shared class definition Pin
NassosReyzidis14-Jun-05 1:27
NassosReyzidis14-Jun-05 1:27 
Generalaccessing HID + c# Pin
g00fyman8-Jun-05 23:54
g00fyman8-Jun-05 23:54 
GeneralRe: accessing HID + c# Pin
Dave Kreskowiak9-Jun-05 6:45
mveDave Kreskowiak9-Jun-05 6:45 
GeneralRe: accessing HID + c# Pin
g00fyman9-Jun-05 18:54
g00fyman9-Jun-05 18:54 
GeneralRe: accessing HID + c# Pin
Dave Kreskowiak10-Jun-05 1:29
mveDave Kreskowiak10-Jun-05 1:29 
GeneralRe: accessing HID + c# Pin
g00fyman10-Jun-05 1:35
g00fyman10-Jun-05 1:35 
GeneralC# Sql INSERT statment Pin
Rinventive8-Jun-05 23:33
Rinventive8-Jun-05 23:33 
I am trying to insert data into a Access db. I am able to connect to the db fine. I get an error in the catch telling me I have a problem with my sql statment.

This is my sql statment. (I have checked the spelling of all variables and field, table names etc...)

All information is comming from textboxes

--except newNum -- uses a method to find the next avalible number

(worked like this on a different db)

string sqlString = "INSERT INTO Cafe (CustomerNumber, FirstName, LastName, Address, City, Province, PostalCode, PhoneNumber, UserName, Password, TimePurchased ) VALUES ("
+ newNum.ToString()
+ ",'" + FirstNameTxt.Text
+ "','" + LastNameTxt.Text
+ "','" + AddressTxt.Text
+ "','" + CityTxt.Text
+ "','" + ProvinceTxt.Text
+ "','" + PostalCodeTxt.Text.ToUpper()
+ "','" + PhoneNumTxt.Text
+ "','" + UserNameTxt.Text
+ "','" + PasswordTxt.Text
+ "'," + TimePurchaseTxt.Text.ToString()
+ ")";


the Access db is called Assignment3

the table is called Cafe

CustomerNumber (autoNumber) PK
FirstName (Text)
LastName (Text)
Address (Text)
City (Text)
Province (Text)
PostalCode (Text)
PhoneNumber (Number)
UserName (Text)
Password (Text)
TimePurchased (Number)

I am new to sql and would really like some help

Thanks
GeneralRe: C# Sql INSERT statment Pin
codeprojectin8-Jun-05 23:47
codeprojectin8-Jun-05 23:47 
GeneralRe: C# Sql INSERT statment Pin
Rinventive9-Jun-05 0:25
Rinventive9-Jun-05 0:25 
GeneralRe: C# Sql INSERT statment Pin
Colin Angus Mackay8-Jun-05 23:56
Colin Angus Mackay8-Jun-05 23:56 
GeneralRe: C# Sql INSERT statment Pin
Rinventive9-Jun-05 0:30
Rinventive9-Jun-05 0:30 
GeneralRe: C# Sql INSERT statment Pin
Carsten Zeumer9-Jun-05 0:54
Carsten Zeumer9-Jun-05 0:54 
GeneralRe: C# Sql INSERT statment Pin
Rinventive9-Jun-05 0:57
Rinventive9-Jun-05 0:57 
GeneralRe: C# Sql INSERT statment Pin
Carsten Zeumer9-Jun-05 1:03
Carsten Zeumer9-Jun-05 1:03 
GeneralRe: C# Sql INSERT statment Pin
V.9-Jun-05 1:02
professionalV.9-Jun-05 1:02 
GeneralRe: C# Sql INSERT statment Pin
Colin Angus Mackay9-Jun-05 1:06
Colin Angus Mackay9-Jun-05 1:06 
GeneralRe: C# Sql INSERT statment Pin
Rinventive9-Jun-05 1:13
Rinventive9-Jun-05 1:13 
GeneralRe: C# Sql INSERT statment Pin
Dave Kreskowiak9-Jun-05 6:38
mveDave Kreskowiak9-Jun-05 6:38 
GeneralRe: C# Sql INSERT statment Pin
Rinventive9-Jun-05 1:28
Rinventive9-Jun-05 1:28 
GeneralRe: C# Sql INSERT statment Pin
Colin Angus Mackay9-Jun-05 1:31
Colin Angus Mackay9-Jun-05 1:31 
GeneralRe: C# Sql INSERT statment Pin
Rinventive9-Jun-05 1:34
Rinventive9-Jun-05 1:34 
GeneralRe: C# Sql INSERT statment Pin
Rinventive9-Jun-05 1:42
Rinventive9-Jun-05 1:42 
GeneralRe: C# Sql INSERT statment Pin
Rinventive9-Jun-05 1:53
Rinventive9-Jun-05 1:53 
GeneralRe: C# Sql INSERT statment Pin
vincent.reynolds9-Jun-05 5:50
vincent.reynolds9-Jun-05 5:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.