Hola!!
Haciendo un select count(*) from tabla, ¿como recupero el valor?
Estoy usando c#.net 2005 y una bbdd de access 2003.
ADODB.Connection cn = new ADODB.Connection();
ADODB.Recordset res = new ADODB.Recordset();
object objAffected;
string strStatement = "Select count(*) from mayoristas";
string cnStr;
string fichero = "..\\..\\bd1.mdb ";
int resultado;
try
{
cnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fichero;
cn.Open(cnStr, null, null, 0);
res=cn.Execute(strStatement, out objAffected, 0);
}
finally
{
cn.Close();
}
Leer las respuestas