var ScriptId = "null"; string sql = "Select Max(ScriptId) from tbl_Script"; SqlCommand cmd = new SqlCommand(sql, connection); using (var reader = cmd.ExecuteReader()) { if (reader["ScriptId"] == System.DBNull.Value) { ScriptId += 1; } else { ScriptId = ScriptId++; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)