Try:
using (SqlCommand cmd = new SQLCommand("proc_urdatabase", con))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@string1", "hello!");
cmd.Parameters.AddWithValue("@string2", "goodbye");
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
...
}
}
"StoredProcedureCommand.ExecuteReader();
this statement is not working
command.ExecuteReader(); is working but after this while condition is not working"
It depends on your stored procedure: if it does not return any values, then the reader will be empty. Are you returning a single scalar value instead? If so, this may help:
Retrieving Scalar Data from a Stored Procedure[
^]
[edit]StoredProcedureCommand changed to cmd - oops![/edit]