1
Answer

Error: not all code paths return a value ???

viktors

viktors

20y
1.8k
1
hi can someone please tell me where i am going wrong in my code and why i am getting an error of this kind.. protected SqlDataReader BindState() { SqlConnection myConnection = new SqlConnection(ConnStr); SqlCommand myCommand = new SqlCommand("sp_das_state_sel",myConnection); myCommand.CommandType = CommandType.StoredProcedure; try { myConnection.Open(); return (myCommand.ExecuteReader(CommandBehavior.CloseConnection)); } catch (SqlException SQLexc ) { Response.Write(SQLexc.ToString()); } finally { myConnection.Close(); myCommand.Connection.Close(); } } thanks.. :)
Answers (1)