example job id = 110000, 112000, 113000 , i want to check character no 3 from left (2) is not zero, this is my query:
SqlCommand cmd = new SqlCommand(" SELECT [job_id], [name_job] FROM [Job] WHERE LEFT(job_id, 2) = @result3 AND SUBSTRING(job_id, 2, 1) != '0' ORDER BY name_job", con);
cmd.Parameters.Add("@result3", SqlDbType.Char, 2).Value = result2; //this is the fist 2 character from job_id
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
con.Open();
sda.Fill(dt);
con.Close();
DropDownList1.DataSource = dt;
DropDownList1.DataTextField = "job_id";
DropDownList1.DataValueField = "name_job";
DropDownList1.DataBind();