|
-
Nov 5th, 2004, 07:57 AM
#1
Thread Starter
Frenzied Member
Inserting radio buttons values into a database [* resolved *]
Hello,
I have a database with 3 fields High and Low. The datatype in the database using MS Access is 'YesNo'.
I have this code in Visual C#
Code:
OleDbCommand cmdInsert = cnnstrInsert.CreateCommand();
cmdInsert.CommandType = CommandType.Text;
cmdInsert.CommandText = @"INSERT INTO Customer(Customer, High, Low) VALUES('" + txtCustID.Text + "', '" + radHigh.Checked + "', "' + radLow.Checked + "') ";
cmdInsert.ExecuteNonQuery();
There is nothing wrong with the actual syntax, but how do l send the values for the radio buttons to the database.
I keep getting a error msg say "incorrect datatype match". So started to do some testing and used this in the connection string instead.
@"INSERT INTO Customer(Customer, High, Low) VALUES('" + txtCustID.Text + "', 'True', 'False') ";
This still gave the same error.
Can anyone tell me the correct way to insert the values of radio buttons into a database.
Many thanks in advance,
Steve
Last edited by steve_rm; Nov 11th, 2004 at 09:58 AM.
steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|