Adding combo box value to datagrid column filled by SQL

Struggling to find an answer on this one. I have a Windows app, on which an operator scans a barcode and the app returns some information based on the barcode from an SQL Database. This then adds a row to a DataGridView control. I’ve been asked to make a change – On the same form… Read More Adding combo box value to datagrid column filled by SQL

BindingList to DataGridView, but get empty cells

I’m trying to place BindingList data into a default DataGridView, but without success. If I run the Form, it shows a DataGridView with empty rows. So the number of rows is correct, but the data itself is missing. Imports System.ComponentModel Public Class Form1 Public Sub New() InitializeComponent() ‘Declare BindingList Dim bList As BindingList(Of User) ‘Init… Read More BindingList to DataGridView, but get empty cells

C# Combo box default value

I am trying to make SQL statement based on item selected throw combo box. I want to have default item selected as ID, but now it returns NULL. What am I doing wrong? private void Win_Shown(object sender, EventArgs e) { myBox.SelectedValue = "ID"; myBox.SelectedText = "ID"; myBox.SelectedItem = "ID"; myBox.Items.Add("ID"); myBox.Items.Add("Name"); myBox.Items.Add("Surname"); myBox.Items.Add("Mobile"); } Then… Read More C# Combo box default value