Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:33:25+00:00 2026-05-26T10:33:25+00:00

I have an insert statement with a number of DataGridViewComboBoxColumns. When I try and

  • 0

I have an insert statement with a number of DataGridViewComboBoxColumns. When I try and insert the values of these DataGridViewComboBoxColumns into my database the text “False” is being inserted into the fields.

Why is this happening?

Dim para As New SqlClient.SqlParameter
Dim dateValue As String = CStr(DateTimePicker1.Value)
Dim calendar = Microsoft.VisualBasic.Left(dateValue, 10)
para.ParameterName = "@company"
para.Value = company.Selected.ToString
para.ParameterName = "@division"
para.Value = division.Selected.ToString
para.ParameterName = "@date"
para.Value = DateTimePicker1.Value
para.ParameterName = "@supplier"
para.Value = supplier.Selected.ToString
para.ParameterName = "@material_group"
para.Value = materialGroup.Selected.ToString
para.ParameterName = "@cost"
para.Value = netprice.Selected.ToString
para.ParameterName = "@dsc"
para.Value = description.Selected.ToString
para.ParameterName = "@email"
para.Value = cmbEmail.SelectedValue
para.ParameterName = "@userID"
para.Value = id
para.ParameterName = "@Name"
para.Value = txtEmployee.Text
para.ParameterName = "@val"
para.Value = newName
para.ParameterName = "@quantity"
para.Value = quantity.Selected.ToString
para.ParameterName = "@wbs"
para.Value = wba.Selected.ToString
para.ParameterName = "@marketingCode"
para.Value = markCodes.Selected.ToString
para.ParameterName = "@hccNumber"
para.Value = hccNumber.Selected.ToString
para.ParameterName = "@currency"
para.Value = currency.Selected.ToString

Insert details:

Dim con As New SqlClient.SqlConnection
Dim myCommand As New SqlClient.SqlCommand
myCommand.Parameters.Add("@company", SqlDbType.NVarChar, 30).Value = company.Selected.ToString
myCommand.Parameters.Add("@division", SqlDbType.NVarChar, 30).Value = division.Selected.ToString
myCommand.Parameters.Add("@date", SqlDbType.NVarChar, 30).Value = DateTimePicker1.Value
myCommand.Parameters.Add("@supplier", SqlDbType.NVarChar, 30).Value = supplier.Selected.ToString
myCommand.Parameters.Add("@material_group", SqlDbType.NVarChar, 30).Value = materialGroup.Selected.ToString
myCommand.Parameters.Add("@cost", SqlDbType.NVarChar, 30).Value = netprice.Selected.ToString
myCommand.Parameters.Add("@dsc", SqlDbType.NVarChar, 30).Value = description.Selected.ToString
myCommand.Parameters.Add("@email", SqlDbType.NVarChar, 30).Value = cmbEmail.SelectedValue
myCommand.Parameters.Add("@userID", SqlDbType.NVarChar, 30).Value = id
myCommand.Parameters.Add("@Name", SqlDbType.NVarChar, 30).Value = newName
myCommand.Parameters.Add("@quantity", SqlDbType.NVarChar, 40).Value = quantity.Selected.ToString
myCommand.Parameters.Add("@wbs", SqlDbType.NVarChar, 40).Value = wba.Selected.ToString
myCommand.Parameters.Add("@marketingCode", SqlDbType.NVarChar, 40).Value = markCodes.Selected.ToString
myCommand.Parameters.Add("@hccNumer", SqlDbType.NVarChar, 40).Value = hccNumber.ToString
myCommand.Parameters.Add("@currency", SqlDbType.NVarChar, 40).Value = currency.Selected.ToString

Dim myAdapter As New SqlClient.SqlDataAdapter
Dim sql As String = "Insert into details (company, division, date, supplier, material_group, cost, dsc, email, userID, fullName, marketingCode, wbs, qty, currency) VALUES (@company, @division, @date, @supplier, @material_group, @cost, @dsc, @email, @userID, @Name, @marketingCode, @wbs, @quantity, @currency)"
myCommand.Connection = con
myCommand.CommandText = sql
myAdapter.InsertCommand = myCommand
myCommand.Connection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:33:26+00:00Added an answer on May 26, 2026 at 10:33 am

    You are storing if something is selected.

    para.Value = company.Selected.ToString 
    

    Selected is a boolean!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have a prepared statement INSERT INTO mst(time) VALUES (?); where time is of
SQL statement: INSERT INTO order (`ORDER_ID`,`SALE_CODE`,`CREATED_AT`,`UPDATED_AT`) VALUES ('2646253286','HPHS20','2009-07-11 12:07:40','2009-07-11 12:07:40') Error: You have an
I seem to have run into difficulties with a simple database insert statement. I'm
I have a sql statement which is a routine insert of two values into
Hey guys quick question, I currently have an insert statement $query= INSERT into new_mail
I have one multi-row INSERT statement (300 or so sets of values) that I
I have an insert statement: insert into parentTbl select firstId, secondId, thirdId, dateTm from
I have an INSERT statement that looks like this: INSERT INTO officer (officer_number, name,
Consider this statement: INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE d=d+1;
I am inserting a number of fields into the database. One of the fields

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.