0

Hi, if I connected access data base to vb form and I want to insert value of dropdown list(Items are yes and no) into the data base (field is type of Yes/No) what will be the insert statement?!

2
Contributors
9
Replies
10
Views
9 Years
Discussion Span
Last Post by Jx_Man
0

cmcontact.CommandText = ("insert into table1_local(y/n) values (" + Me.DropDownList1.SelectedValue + ");")

I got syntax error.. I tried to put the drop down list values 1 and 0 also I tried to put them true and false both times I got error

0

you have dropdownlist with value Yes and No. you want to insert selected value in dropdownlist to db.

cmcontact.CommandText = "INSERT INTO TableName(ColumnName) VALUES('" & Me.DropDownList1.SelectedValue & "')"

What kind of error was come?

0

I found the solution!
my column name was y/n
this contains special char (/) when i removed this char it worked
thanx any way

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.