plz get item name and item code from dropdown ie
dr[0] is item name
and dr[1] is item code
SqlDataReader dr = command.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
string p;
if (dr[0].ToString() == null || dr[0].ToString() == "";)
{
}
else
{
drp.Items.Add(new ListItem(dr[0].toString(),dr[1].toString())
}
}
}
from this code you save itemname as text and itemcode as value of dropdown
now you can get value of dropdown using following Code
int itemCode = Convert.Int32(drp.SelectedValue);
and save itemcode in your databse
may be this will help you