S
Shum
Hi!
I want to restrict the selected records with a WHERE clause in
dataadapter... but when i do that no rows are retrieved... Any
alternatives?? Any suggestions? (using sql server 2005 and c#)
..
..
..
..
while (drr.Read())
{
hosp=System.Convert.ToString(drr["HospitalName"]);
SqlDataAdapter da = new SqlDataAdapter("SELECT TotalPatients
from Patients
WHERE HospitalName='hosp' ",con1);
SqlCommandBuilder cb = new SqlCommandBuilder(da);
DataSet ds = new DataSet();
da.Fill(ds,0,0,"Patients");
int rowcount=System.Convert.ToInt16(da.Fill(ds,0,0,"Patients"));
for (int i; i<=rowcount; i++)
{
int totpat=System.Convert.ToInt32(ds.Tables["Patients"].Rows
["TotalPatients"]);
MessageBox.Show(Convert.ToString(totpat));
}
}
..
..
..
I want to restrict the selected records with a WHERE clause in
dataadapter... but when i do that no rows are retrieved... Any
alternatives?? Any suggestions? (using sql server 2005 and c#)
..
..
..
..
while (drr.Read())
{
hosp=System.Convert.ToString(drr["HospitalName"]);
SqlDataAdapter da = new SqlDataAdapter("SELECT TotalPatients
from Patients
WHERE HospitalName='hosp' ",con1);
SqlCommandBuilder cb = new SqlCommandBuilder(da);
DataSet ds = new DataSet();
da.Fill(ds,0,0,"Patients");
int rowcount=System.Convert.ToInt16(da.Fill(ds,0,0,"Patients"));
for (int i; i<=rowcount; i++)
{
int totpat=System.Convert.ToInt32(ds.Tables["Patients"].Rows
["TotalPatients"]);
MessageBox.Show(Convert.ToString(totpat));
}
}
..
..
..