Big Pimpin

Big Pimpin

  • NA
  • 3
  • 2.3k

Is DS Out Of Scope Or Am I Free To Access From A Method?

Sep 3 2015 9:11 PM
This is my syntax, I want to know if I can access DS from my _SelectedItemIndexChange in a different method in my partial ABCD class?
 [code]
 
namespace Test.Pages
{
public partial class ABCD : Pages
{
public Dataset DS = new DataSet()
public MainClass classE = new MainClass();
protected void itemPick_SelectedIndexChanged(object sender, EventArgs e)
{
DS = classE.PullSQLData();
}
}
}
public class MainClass
{
private DataSet DS = new DataSet();
private StringBuilder SB = new StringBuilder();
public DataSet PullSQLData()
{
string databaseConnection = "";
DS = new DataSet();
SqlQueryBuilder = new StringBuilder();
SqlQueryBuilder.Append("exec dbo.GetSQLData ");
DS = ExecuteSqlQuery(databaseConnection, SqlQueryBuilder.ToString());
return DS;
}
}
[/code]