Hi,
i tried to get the count of rows using dataset but what ever i did so even the count will remains '1' how can i get the exact row count
this is my code ..
please give me a solution as soon as possible
here is my code
==================
Int64 count;
if (FileUpload1.HasFile)
{
string filename = FileUpload1.FileName;
string ext = Path.GetExtension(FileUpload1.FileName);
if ((ext == ".doc") || (ext == ".pdf") || (ext == ".docx"))
{
SqlConnection conn = new SqlConnection();
SqlCommand cmd = new SqlCommand();
string connStr = ConfigurationManager.ConnectionStrings["seamanconn"].ConnectionString;
conn.ConnectionString = connStr;
cmd.Connection = conn;
cmd.CommandText = "select * from trainingfile";
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
conn.Open();
da.SelectCommand = cmd;
da.Fill(ds);
conn.Close();
int i = ds.Tables[0].Rows.Count;
if (ds.Tables[0].Rows.Count > 0)
{
count = Convert.ToInt64(ds.Tables[0].Rows[0][0].ToString());
}
else
{
count = 0;
}
count++;
}
}
"Personality has the power to open many doors, but character must keep them open"