[RESOLVED] PLZ help meeeeeeeeeee
when we do this system generate error
Operator '+' cannot be applied to operands of type 'object' and 'int'
if (dReader.Read())
{
return dReader[0] + 1;
}
And
when we do this system generate error
Cannot implicitly convert type 'string' to 'bool'
if (strTableName = "")
{
dAdapter.Fill(dSet);
}
Re: PLZ help meeeeeeeeeee
this one.
VB Code:
return (int)dReader[0] + 1;
and for your second problem please try to explain in details so that it is easy to identify. :bigyello:
Re: PLZ help meeeeeeeeeee
The solution to the second one is :
Code:
if (strTableName == "")
{
dAdapter.Fill(dSet);
}
double equal sign for comparison .
Re: PLZ help meeeeeeeeeee
Quote:
Originally Posted by fret
this one.
VB Code:
return (int)dReader[0] + 1;
and for your second problem please try to explain in details so that it is easy to identify. :bigyello:
In C# it would be something like :
return int.Parse(dReader[0]) + 1;
Re: how we can do this in c sharp not in vb.net
if (dReader.Read())
{
return dReader[0] + 1;
}
Re: PLZ help meeeeeeeeeee
our purpose is auto generate Id we pick max id in data reader and add one in max id
we do this but system generate error
The best overloaded method match for 'int.Parse(string)' has some invalid arguments
Argument '1': cannot convert from 'object' to 'string'
if (dReader.Read())
{
return int.Parse(dReader[0])+ 1;
}
Re: PLZ help meeeeeeeeeeeeeee
our purpose is auto generate Id we pick max id in data reader and add one in max id
we do this but system generate error
The best overloaded method match for 'int.Parse(string)' has some invalid arguments
Argument '1': cannot convert from 'object' to 'string'
if (dReader.Read())
{
return int.Parse(dReader[0])+ 1;
}
Re: PLZ help meeeeeeeeeee
thanks for this coperation