Hi,
The issue may look very simple. I have a small piece of code which fills dataset by getting the data using storedproc. Here goes the code.
I have two empId ex : 1001 and 1002. When I execute the storedproc in sql server both the empId's returning 1 record. But when I tried to execute the above code from VS for the first empId the rows.count=1 but for the second empId it shows rows.count = 0.
Not sure why is this happening even though data exists in table and storedproc returns the record.
Can anyone help me in understanding what might be going wrong here.
Thanks in advance,
Pavan
The issue may look very simple. I have a small piece of code which fills dataset by getting the data using storedproc. Here goes the code.
Dim sqlAdp As SqlDataAdapter Dim com As New SqlCommand Dim ds As New DataSet sqlAdp = New SqlDataAdapter() Dim sqlselectcom As New SqlClient.SqlCommand sqlselectcom.Connection = Me.SqlConnection1 Try sqlselectcom.Connection = Me.SqlConnection sqlselectcom.CommandText = "Get_Emp_Details" sqlselectcom.CommandType = CommandType.StoredProcedure sqlselectcom.Parameters.Add("@EmpID", SqlDbType.Int) sqlselectcom.Parameters("@EmpID").Value = empId sqlselectcom.Parameters.Add("@EmpStatus", SqlDbType.Bit) sqlselectcom.Parameters("@EmpStatus").Value = 1 sqlAdp.SelectCommand = sqlselectcom sqlAdp.Fill(ds) k = ds.Tables(0).Rows.Count
I have two empId ex : 1001 and 1002. When I execute the storedproc in sql server both the empId's returning 1 record. But when I tried to execute the above code from VS for the first empId the rows.count=1 but for the second empId it shows rows.count = 0.
Not sure why is this happening even though data exists in table and storedproc returns the record.
Can anyone help me in understanding what might be going wrong here.
Thanks in advance,
Pavan
Last edited by a moderator: