Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Populate datagridview using sql query with a variable

$
0
0
Hi, I am having trouble working this out and I am new to programming.

Basically I have a datagridview which is supplied using a dataset.

When editing that dataset in designer you can specify an sql query which is :

 

SELECT [MFNO],[BOARDTYPE] FROM [::this].[mfno] WHERE CUSTCODE = '& CUSTCODE1 &'




I am trying to use the ' & CUSTCODE1 & ' as a variable.
This variable I am hoping will be changed when the a textbox value on the form is changed so it will show only the MFNO for the typed custcode in the text box.

I have declared a variable in form.cs

public class CUSTCODE
{
    public  static string CUSTCODE1 = "PEP001";
}





My textbox on changed code is


string CUSTCODE = textBox1.Text;




I know I am way off but any help will be appreciated.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>