Question Datagridview Content and ComboBox Selected value save in Databse

prasad kulkarni

Well-known member
Joined
Sep 7, 2009
Messages
62
Programming Experience
1-3
Hi,

I am using vb.net 2005 (Window Application)
In my Form there is Datagridview & I give datasource(dataset) to datagridview.
I Save All Content of datagridview to database(sql server 2000) using dataAdapter.Update(dataset,"tablename").
And in my form 2 ComboBox outside the datagridview . I want to save ComboBox selected value to database,
In my Database, all field of Datagridview and ComboxBox field both are there.
But when I Save All Content of datagridview to databse using dataAdapter.Update(dataset,"tablename"),
combobox selected value not save in database. How can I save all content of datagridview and ComboBox selected value
at same time in database.

if any one know, please reply me soon
 
Sounds like your combo is not set up properly

REMOVE any databinding from the .Text property
ADD a proper databining to the .SelectedValue property
Ensure the combo has something sensible set for: DataSource, DisplayMember, ValueMember

e.g.

comboTitle.SelectedValue databinding to myDataset.MyDataTable.PersonTitleID
comboTitle.DataSource = dataset.Titles
comboTitle.DisplayMember= "TitleDescription"
comboTitle.ValueMember = "TitleID"
 

Latest posts

Back
Top