1
Answer

i have four radio button i have to generate a code based on

prabha haran

prabha haran

7y
374
1
hi
 
i have radio button TP and TR
 
when i select TP my code should be KNC/TP/1 in my text box serially
when i select TR my code should be KNC/TR/1 in my text box and save in database
 
my code is
 
string selectedval = rbl.SelectedValue;
if(selectedval=="TR")
{
txticode.Text = objDataAccess.Autoid("select top 1(InstrumentID) from Tbl_Instrument order by InstrumentID desc", "KNC/TR/");

}
if (selectedval == "TP")
{
txticode.Text = objDataAccess.Autoid("select top 1(InstrumentID) from Tbl_Instrument order by InstrumentID desc", "KNC/TP/");


}
if (selectedval == "SP")
{
txticode.Text = objDataAccess.Autoid("select top 1(InstrumentID) from Tbl_Instrument order by InstrumentID desc", "KNC/SP/");

}
if (selectedval == "IN")
{
txticode.Text = objDataAccess.Autoid("select top 1(InstrumentID) from Tbl_Instrument order by InstrumentID desc", "KNC/IN/");

 
 
 
Answers (1)