Forums - C# Corner

Forum guidelines
prabha haran

prabha haran

  • 1.4k
  • 55
  • 6.1k

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

Apr 15 2017 3:22 AM
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)