TheChaseMan's Frenetic SoapBox

Always looking for better ways to do things...

CS0136 - Duh

//You can do this

int x = 1;

if(x > 0)

{

    DataSet ds = new DataSet();   

}

else

{

    DataSet ds = new DataSet();

}

 

 

//But, you can't do this!

DataSet ds = new DataSet();   

int x = 1;

if(x > 0)

{

    DataSet ds = new DataSet(); //CS0136

}

        

//...or this!

int x = 1;

if(x > 0)

{

    DataSet ds = new DataSet();                   

}

Console.WriteLine(ds.Tables.Count); //CS0246



Read on... 0 Comments...

Digg!

posted on Tuesday, August 10, 2004 1:36 PM

Feedback

# re: CS0136 - Duh 7/27/2005 2:37 AM John

Not being able to do
//...or this!

int x = 1;

if(x > 0)

{

DataSet ds = new DataSet();

}

Console.WriteLine(ds.Tables.Count); //CS0246

Is OK,
but
ot being able to do
int x = 1;
if(x > 0)
{
DataSet ds = new DataSet();
}
DataSet ds = newDataset(); // CS0136

Is dumb!