Variables defined in the partial class - ASP.NET 2.0



I apologise in advance for such a basic question, but I'm hoping someone will
take the time to answer my question.

In my code I define a Dataset :

Partial Class Default_aspx
Dim dsExcel As New DataSet

I fill the Dataset as follows :


Sub btnExcelList_Click(ByVal sender As Object, ByVal e As System.EventArgs)
<snip>
myData.Fill(dsExcel)


And I try to interrogate it in another sub :-

Sub btnImportLabinfo_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
<snip>
lblOutput.Text = CType(dsExcel.Tables(0).Rows.Count, String)


However, the scope of dsExcel is lost and I cannot retrieve the data. It
works in ASP.NET 1.1 where the whole class is defined in the code behind page.

I would really appreciate it if someone answered me.
Many thanks in advance,
SteveB.
.



Relevant Pages

  • Re: Return db record from a function - how?
    ... of a String? ... >> This may be a very basic question but it's something I've never done ... But I want to call a Function from another Sub and the function ... DataReader? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Help with Inheritance
    ... This may be a basic question, but it sure has me stumpted.. ... class has some varibles that need to be reset from time to time, ... dim mPrice as double ... end sub ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Problem with IF Statement Using Complex Variables
    ... <snip: basic question about FP> ... About Floatting Point Arithmetic". ... (That title is from memory; ...
    (comp.lang.fortran)
  • Re: Variables defined in the partial class - ASP.NET 2.0
    ... way of handling variable postbacks. ... > Sub btnSet_Click ... >>> I apologise in advance for such a basic question, ... >>> Dim dsExcel As New DataSet ...
    (microsoft.public.dotnet.framework.aspnet)
  • Return db record from a function - how?
    ... This may be a very basic question but it's something I've never done before. ... I've looked at a couple of my favorite sites and books and can't find an ... But I want to call a Function from another Sub and the function finds ... DataReader? ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast