hi guyz!!! can anybody please help me...CUrrently, i have this code below
as you can see i dont have a way if '(int)sqlCmd.ExecuteScalar ();' really returns a value or should i say had retrieved a value from my users table. My question is, how will check if '(int)sqlCmd.ExecuteScalar ();' method had retrieve or has a value. THanks in advance!!Code:string qryStr = "Select Max(id) from users"; sqlCOmmand sqlCmd = new SqlCommand (qryStr, sqlConn); int max_number = (int)sqlCmd.ExecuteScalar (); sqlConn.Close (); return max_number;




Reply With Quote