>CREATE PROCEDURE wit_GetPickListData > @ItemType VARCHAR(20) > >AS >BEGIN > > SELECT ItemKey, ItemType, Caption, ItemDesc > FROM wit_PickLists > WHERE ItemType = @ItemType > ORDER BY Caption > >END >>
>// Bind the data set to the listbox >lstItems.DataSource = dsItems.Tables[0]; >lstItems.DisplayMember = "Caption"; > >lstItems.SelectedIndex = -1; > >// Bind the caption >txtCaption.DataBindings.Add("Text", dsItems.Tables[0], "Caption"); >>
>public void UpdateDataSet(DataSet oDS, string sTableName) >{ > if (sTableName == null) > { > sTableName = oDS.Tables[0].TableName; > } > > DataTable oTable = oDS.Tables[sTableName]; > > foreach (DataRow oRow in oTable.Rows) > { > oRow.EndEdit(); > } > > try > { > _oAdapter.Update(oDS, sTableName); > } > catch (SqlException e) > { > throw e; > } >} > >>