viktors

viktors

  • NA
  • 54
  • 0

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

May 14 2004 11:07 AM
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)