apeterson

apeterson

  • NA
  • 12
  • 0

setting up OleDbParameter in C# code

Jan 20 2005 11:50 AM
How do you set up a parameter in c#. Also how will i pass the info to the parameter. I will have a dropdown list and once the user selects the specified article of clothing I will need the program to pass the id to this procedure here is the code I have right now...It's in the Page Load method if (!IsPostBack) { oleDbConnection1.Close(); oleDbConnection1.Open(); ds = new DataSet(); daSizes = new System.Data.OleDb.OleDbDataAdapter( "SELECT [Sizes].[Size] FROM [Sizes], [Items], [ProductSizes] WHERE (([Items].[Clot" + "hingID] = [ProductSizes].[ClothingID]) AND ([ProductSizes].[SizeID] = [Sizes].[S" + "izeID]) AND ([Items].[ClothingID] = @ClothingID))", oleDbConnection1); daSizes.Fill(ds, "Sizes"); DropDownList1.DataSource = ds.Tables["Sizes"]; DropDownList1.DataTextField = "Size"; this.DataBind(); oleDbConnection1.Close(); }

Answers (1)