Akhter HUssain

Akhter HUssain

  • 720
  • 1.3k
  • 101.2k

How to add Data in gridview from Dropdownlist ?

Aug 6 2019 9:37 AM
I want to add data from dropdown list to gridview ,,,
here my code 
  1. con.Open();  
  2.          SqlDataAdapter adpr1 = new SqlDataAdapter("select * from ItemMasterFile ", con);  
  3.          DataSet dspr1 = new DataSet();  
  4.          adpr1.Fill(dspr1);  
  5.          DropDownList1.DataSource = dspr1.Tables[0];  
  6.          DropDownList1.DataTextField = "Descriptionitem";  
  7.          DropDownList1.DataValueField = "Codeitem";  
  8.          DropDownList1.DataBind();  
i want to insert Datatextfield and Datavalue into gridview... 
 
 

Answers (5)