Beginners question

Discussion in '.NET' started by tsaprout, Jun 19, 2008.

  1. tsaprout

    tsaprout

    Joined:
    Jun 4, 2008
    Messages:
    7
    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.
     
    tsaprout, Jun 19, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex
    Replies:
    1
    Views:
    300
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Apr 19, 2004
  2. Mike P

    web service beginners question

    Mike P, Aug 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    761
    S. Justin Gengo
    Sep 21, 2004
  3. Roger stevenson

    Beginners Question Regarding Static Web Pages

    Roger stevenson, Apr 30, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    417
    Sam Samnah
    Jul 1, 2005
  4. Child
    Replies:
    2
    Views:
    1,034
    souri challa
    Jun 1, 2005
  5. =?Utf-8?B?Qi4gQ2hlcm5pY2s=?=

    Late night beginners question

    =?Utf-8?B?Qi4gQ2hlcm5pY2s=?=, Jul 31, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    367
    =?Utf-8?B?Qi4gQ2hlcm5pY2s=?=
    Jul 31, 2005
Loading...

Share This Page