Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > OleDbCommand insert command ends with bool value
 

OleDbCommand insert command ends with bool value

my command is like
 insert into stock (stockcode, stockname, isactive, cost, external) values ('abc','def','0', '0','0')

the field "isactive" and "external" are both bool type. when i take out "external" the query works just fine.
is there a limitation in the oledbcommand that the last column in the insert query can not be of type bool?

please help!

Achievement provides the ultimate pleasure in life
  • Edited byssfftt Thursday, October 08, 2009 1:24 AM
  •  
ssfftt  Wednesday, October 07, 2009 3:26 PM
What happens if you leave in the Weighted? Does it generate an error? Or just not insert the value?
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Wednesday, October 07, 2009 6:11 PM
thanks Deborahk for your reply

when I leave in the Weighted i get error "there is a syntax error in the insert query", and no more details...
oh, actually, the last value's column name is "external", not weighted, i should edit my post. in which case is the "external" a reserved word?
Achievement provides the ultimate pleasure in life
ssfftt  Thursday, October 08, 2009 1:23 AM
If this is Access, then it looks like "external" is a reserved word.

See this link:

http://support.microsoft.com/kb/321266

You *should* be able to still use it. I believe you just need to put brackets around it: [external].

Give that a try.
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  15 hours 9 minutes ago
hi Deborahk, thanks "external" is reserved. now i put it around "[]" in Insert clause, and get another error: datatype mismatch......

I tried string or bool value no luck.... 

Achievement provides the ultimate pleasure in life
ssfftt  14 hours 7 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• datagrid with checkboxes
• How to Populate values of dropdown list in a datagrid in C#
• Databinding objects - Two-way binding problem?!
• Filtered BindingSouce Find not working.
• ComboBox DataBinding
• TRACK A THREAD WITH A PROGRESSBAR
• Simple question on ComboBox Databinding look up.
• Inserting a button in the rows of a datagrid exactly beside the value of one specific colmn
• BindingSource empty data set
• Trouble having column in datatable recognize the data source