Hi,
I have an SP like this;
-
- ALTER Procedure [dbo].[VerificationControl](
- @Value1 nvarchar(16),
- @Value2 nvarchar(4),
- @Value3 nvarchar(6),
- @Value4 nvarchar(10),
- @Value5 nvarchar(20),
- @Value6 nvarchar(20) output,
- @Value7 nvarchar(20) output,
- @Value8 nvarchar(50) output
- )
- AS
- BEGIN
- ....
- ....
I am using reader = cmd.ExecuteReader();
But I cannot get any data from while (reader.Read()).
When I debug I cannot enter
while (reader.Read()) loop.
-
- SqlConnection cnn;
- cnn = new SqlConnection(connetionString);
-
-
-
- SqlCommand cmd = new SqlCommand();
- SqlDataReader reader;
- DataTable dt = new DataTable();
-
- cmd.CommandText = "VerificationControl";
- cmd.CommandType = CommandType.StoredProcedure;
- cmd.Parameters.AddWithValue("@Value1", "AAA"
- cmd.Parameters.AddWithValue("@Value2", "BBB"
- cmd.Parameters.AddWithValue("@Value3", "CCC"
- cmd.Parameters.AddWithValue("@Value4", "DDD"
- cmd.Parameters.AddWithValue("@Value5", "EEE"
- cmd.Parameters.AddWithValue("@Value6", "");
- cmd.Parameters.AddWithValue("@Value7", "");
- cmd.Parameters.AddWithValue("@Value8", "");
- cmd.Connection = cnn;
-
- cnn.Open();
- reader = cmd.ExecuteReader();
-
- while (reader.Read())
- {
- string mCusName = "";
- mCusName = reader[0].ToString();
-
- string mSurName = "";
- mSurName = reader[1].ToString();
-
- string mStatusCode = "";
- mStatusCode = reader[2].ToString();
- }
-
- reader.Close();
- cnn.Close();
When I look at the my SQL table that my SP works perfectly.
Any help plase?
Kind Regards