SQL query at run time in VB.NET 2005

I have added a datasource, which autmatically created TWOdataset and under TWOdataset it has my Cust table. I dragged the Cust table on my form and a CustdataGridView appeared on my form. I customised the CustdataGridView by taking out few fields which I didnt want it to display.

My problem is: I have got a textbox, save button and a display button on the form. When the user types the text in the textbox and clicks display button, I want the CustdataGridView to display the output:

SELECT custname, custlastname, custaddress
FROM Cust
WHERE custname = < textbox.text >

Can anyone please guide me, so that I can run this query at run time whenever the user types the name in the text box and clicks display.




Answer this question

SQL query at run time in VB.NET 2005

  • i-developer

    In terms of giudance, I want to know how can I handle the problem in terms of displaying the required data (on basis of the SQL query at run time after the user inputs the part of query in textbox) and updating it when changes are made to it. It would be great if I can have a look at an example code, which will help me understand it better.

    Thanks.



  • Steve Whitley

    What is it you need guidance The code to display the data in the grid

  • SQL query at run time in VB.NET 2005