Add combox in gridview - Getting OledbException
-
Hi, I get Oledb Exception:"No value given for one or more required parameters." at line below adapter2.Fill(packDT); // error here on this line Basically i am trying to make a combobox in 2nd row of gridview.. Also one more thing i need to add to my above post..that i need to select some columns from one table and then in one of the column of the gridview i need to add combobox in gridview... OleDbDataAdapter adapter1 = new OleDbDataAdapter("select BillD.ProductName,BillD.ProductID,BillD.Saletype,BillD.InQty,BillD.SBtype,BillD.Dis1,BillD.Type,BillD.InPrice from BillDetails BillD", database); OleDbDataAdapter adapter2 = new OleDbDataAdapter("Select P.ProductName,P.ProductID,Packing.PackingName from Packing INNER JOIN Products ON Packing.PackingID=Products.Packing", database);
void fillData()
{
database = new OleDbConnection(connectionS :( :confused:tring);
database.Open();
OleDbDataAdapter adapter1 = new OleDbDataAdapter("select BillD.ProductName,BillD.ProductID,BillD.Saletype,BillD.InQty,BillD.SBtype,BillD.Dis1,BillD.Type,BillD.InPrice from BillDetails BillD", database);
OleDbDataAdapter adapter2 = new OleDbDataAdapter("Select P.ProductName,P.ProductID,Packing.PackingName from Packing INNER JOIN Products ON Packing.PackingID=Products.Packing", database);{ DataGridViewComboBoxColumn dgridcolumn = new DataGridViewComboBoxColumn(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); DataTable packDT = new DataTable(); adapter1.Fill(dt); dataGridView1.DataSource = dt; adapter2.Fill(packDT); // error here on this line ds.Tables.Add(packDT); dataGridView1.DataSource = ds; dataGridView1.DataMember = ds.Tables\[0\].TableName; dgridcolumn.DataSource = ds.Tables\[0\]; dgridcolumn.ValueMember = ds.Tables\[0\].Columns\[1\].ColumnName.ToString(); }
Thanks, please help
-
Hi, I get Oledb Exception:"No value given for one or more required parameters." at line below adapter2.Fill(packDT); // error here on this line Basically i am trying to make a combobox in 2nd row of gridview.. Also one more thing i need to add to my above post..that i need to select some columns from one table and then in one of the column of the gridview i need to add combobox in gridview... OleDbDataAdapter adapter1 = new OleDbDataAdapter("select BillD.ProductName,BillD.ProductID,BillD.Saletype,BillD.InQty,BillD.SBtype,BillD.Dis1,BillD.Type,BillD.InPrice from BillDetails BillD", database); OleDbDataAdapter adapter2 = new OleDbDataAdapter("Select P.ProductName,P.ProductID,Packing.PackingName from Packing INNER JOIN Products ON Packing.PackingID=Products.Packing", database);
void fillData()
{
database = new OleDbConnection(connectionS :( :confused:tring);
database.Open();
OleDbDataAdapter adapter1 = new OleDbDataAdapter("select BillD.ProductName,BillD.ProductID,BillD.Saletype,BillD.InQty,BillD.SBtype,BillD.Dis1,BillD.Type,BillD.InPrice from BillDetails BillD", database);
OleDbDataAdapter adapter2 = new OleDbDataAdapter("Select P.ProductName,P.ProductID,Packing.PackingName from Packing INNER JOIN Products ON Packing.PackingID=Products.Packing", database);{ DataGridViewComboBoxColumn dgridcolumn = new DataGridViewComboBoxColumn(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); DataTable packDT = new DataTable(); adapter1.Fill(dt); dataGridView1.DataSource = dt; adapter2.Fill(packDT); // error here on this line ds.Tables.Add(packDT); dataGridView1.DataSource = ds; dataGridView1.DataMember = ds.Tables\[0\].TableName; dgridcolumn.DataSource = ds.Tables\[0\]; dgridcolumn.ValueMember = ds.Tables\[0\].Columns\[1\].ColumnName.ToString(); }
Thanks, please help
sorry i am not getting exception as i fixed it bec of a pb in sql query...