if ( int id = null) { string sql = "select top 5 * from context"; } else { string sql = "select top 5 * from context where listid=" + id + ""; }
protected string showInfo(int id) { [color=#FF0000]if ( int id = null)[/color] { string sql = "select top 5 * from context"; } else { string sql = "select top 5 * from context where listid=" + id + ""; } string tbody = ""; OleDbDataReader my_reader; OleDbCommand my_comm = new OleDbCommand(); my_comm.CommandText= sql; my_comm.CommandType = CommandType.Text; my_comm.Connection = my_conn; my_conn.Open(); my_reader = my_comm.ExecuteReader(); }
if ( id == null) { string sql = "select top 5 * from context"; } else { string sql = "select top 5 * from context where listid=" + id + ""; }
if (id <= 0)