Dim qry="select max(ID) from tbl_deal where officeid='" & ddl1.SelectedValue.Trim & "'"
dun cmd1 as sqlCommand=New SqlCommand(qry,conn)
dim read As SqlDataReader=cmd1.ExecuteReader()
select COALESCE(max(ID),0) from tbl_deal where officeid=@officeid
If not read(0)= DBNull.Value Then
if Convert.ToString(read(0))<>"" Then
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)