Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have two columns named foscode and formno in table with different identity values..I have two textbox and want to set ident value on page load of web form in both text box..
foscode starts value is 000_11101
formno starts value is 551.
now I want to set different ident foscode value and formno value in differnt text boxes named txtfoscode, txtformno..
So plz help me what to do for that...
thanks in advance
Posted
Updated 19-Feb-14 20:43pm
v2
Comments
The14thNoah 20-Feb-14 2:55am    
do you have started coding this?where do you bind your data?

1 solution

I dont have enough info so far this is what i can help for now
use this snippets as your guide


C#
public void page_Load()
{
 this.LoadYourData();
 var firstColumn=GridView1.SelectedRow.Cells[0].Text;//for foscode
 var secondColumn=GridView1.SelectedRow.Cells[1].Text;//for formno
if(!Page.IsPostBack)
  {
    if(firstColumn.StartWith("000"))
    {
      textfoscode.Text=firstColumn;
    }
   if(secondColumn.StartWith("551"))
    {
      texformno.Text=secondColumn;
    }
  }

}

public void LoadYourData()
{
 //set your connectionstring
 //bind your data into your grid view I guess
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900