Beginners question


Joined
Jun 4, 2008
Messages
7
Reaction score
0
I have the following code:

public partial class _Default : System.Web.UI.Page
{

String sql2 = "";
DataSet ds;

protected void Button1_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
QueryCommand smd = new QueryCommand(sql2);<- HERE sql2 isNOT NULL
ds = DataService.GetDataSet(smd); <- HERE ds isNOT NULL
GridView1.DataSource = ds;
}

protected void GridView1_Sorting1(object sender, GridViewSortEventArgs e)
{
QueryCommand smd = new QueryCommand(sql2); <- HERE sql2 is NULL
ds = DataService.GetDataSet(smd); <- HERE ds is NULL
}
}

Question: How can I get the values of the variables from Button_Click so I can use them in GridView1_Sorting1 method?

Please help me I feel totally lost.

Thank you in advance.
 
Ad

Advertisements


Top