I have the following sql select code, where im trying to get value and i would like to ask user to continue if value is found or start new.
- var getJOB = txtJobNo.Text;
-
- try
- {
- MGMT_CON.Open();
- MGMT_COM = new SqlCommand("SELECT [job],[revno] FROM [MATRR] WHERE [job] = '" + getJOB + "'",
- MGMT_CON);
- var sqlRRev = MGMT_COM.ExecuteReader();
- if (sqlRRev.Read())
- {
-
-
-
-
-
- var revno = Convert.ToInt32(sqlRRev.GetValue(1).ToString());
-
- ddlRR.Text = "BBB-" + getJOB + "-" + (revno + 1);
- }
- else
- {
- ddlRR.Text = "BBB-" + getJOB + "-" + 1001;
- }
- MGMT_CON.Close();
- }
- catch (Exception e)
- {
- ClientScript.RegisterClientScriptBlock(GetType(), "alert", e.Message);
- }
I tried looking around for different solution, one was trying jquery but im not familiar with it.
- <script>
- $(function () {
- $("#dialog-confirm").dialog({
- resizable: true,
- height: 140,
- modal: true,
- buttons: {
- "Use New": function () {
- $(this).dialog("close");
- },
- "Continue": function () {
- $('#<%=Label1.ClientID%>').html("hello");
- $(this).dialog("close");
- }
- }
- });
- });
- </script>
please help.
Thankyou