Hello guys
I am selecting a record from a database with this statements:
BindingSource personalDetailsBindingSource = new BindingSource();
personalDetailsBindingSource.DataSource = GetData("Select * From PersonalDetails where FirstName="+textBox1.Text);
DataGridView2.DataSource = personalDetailsBindingSource;
in the sql statement the where clause is not working at all. If i remove the where clause I get the result of that but with the where clause I get an error.
kindly help,
Thanks in advance
Imtiyaz AnsariPosted Mar 14, 2013, 4:20 PM
HI
character value where condition :- ' " + TxtName.text + " '
numeric value :- " + Txtid.text + "
VulpesPosted Mar 14, 2013, 6:04 AM
personalDetailsBindingSource.DataSource = GetData("Select * From PersonalDetails where FirstName='"+ textBox1.Text + "'");