Help Needed
-
am working on a project with the following codes: Private Sub prono_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles prono.TextChanged obj = objordder.getIDfrmno(CStr(prono.Text)) cmdPid.Text = Val(obj) End Sub where objordder.getIDfrmno is the dll and cmdPid.Text is the destinesion text box the definetion for objordder.getIDfrmno is as follows: public object getIDfrmno(int productno) { SqlConnection con = new SqlConnection(constr); string sql = "select ProductID from tblProduct where productno=" + productno + ""; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); object obj = cmd.ExecuteScalar(); con.Close(); return (obj); } constr is the conecction string but not being able to get the desiered result can anyone hrlp
-
am working on a project with the following codes: Private Sub prono_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles prono.TextChanged obj = objordder.getIDfrmno(CStr(prono.Text)) cmdPid.Text = Val(obj) End Sub where objordder.getIDfrmno is the dll and cmdPid.Text is the destinesion text box the definetion for objordder.getIDfrmno is as follows: public object getIDfrmno(int productno) { SqlConnection con = new SqlConnection(constr); string sql = "select ProductID from tblProduct where productno=" + productno + ""; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); object obj = cmd.ExecuteScalar(); con.Close(); return (obj); } constr is the conecction string but not being able to get the desiered result can anyone hrlp
Arunava35 wrote:
constr is the conecction string
What is the exact connection string you are using?
Arunava35 wrote:
but not being able to get the desiered result can anyone hrlp
In what way? Is it giving you an error message? If so, what is the error message. Or is it giving you a blank screen?
Pete Soheil DigiOz Multimedia http://www.digioz.com
-
Arunava35 wrote:
constr is the conecction string
What is the exact connection string you are using?
Arunava35 wrote:
but not being able to get the desiered result can anyone hrlp
In what way? Is it giving you an error message? If so, what is the error message. Or is it giving you a blank screen?
Pete Soheil DigiOz Multimedia http://www.digioz.com
-
That can only mean that your query is wrong, and/or you didn't take a foreign key relation or something along those lines into consideration.
Pete Soheil DigiOz Multimedia http://www.digioz.com