C# : Autocomplete TextBox Column in the Datagridview With SQL Server

0
1097

DTGTXTSQLAUTOfig.3This time, I will teach you how to create an AutoComplete TextBox Column in the Datagridview using C#.net and SQL server 2005 Express Edition. With this, you can auto-suggest and append the column of the Datagridview.

 

The database of this project is here.

 

 

So, Let’s get started.

 

1. Open Microsoft Visual Studio and create a new windows form application for C#. After that, add a Label and DataGridView in the form and it will look like this.

DTGTXTSQLAUTOfig.1

2. After that, go to the solution explorer and hit “View Code” to fire the code editor.

DTGTXTSQLAUTOfig.2

3. In the code editor, declare and initialize all the classes that are needed.

Note: Put ‘using System.Data.SqlClient;’ above the namespace to access sql server library.

5. Go back to the design view, double-click the and do the following codes for adding a TextBox in the Datagridview and establish a connection between SQL Server 2005 and C#.net.
6. Go back to the design view again and click the Datagridview. After that, go to the properties and hit the lightning symbol. Then, scroll down and find “EditingControlShowing” for the events. Double-click it to fire the event handler of it.

DTGTXTSQLAUTOfig.2.1

7. Do the following codes in the method to make the TextBox Column autoComplete.

 

Output:

DTGTXTSQLAUTOfig.3

For all students who need a programmer for your thesis system or anyone who needs a source code in any a programming languages. You can contact me @ :

 

 

Email – [email protected]
Mobile No. – 09305235027 – TNT

 

 

Download Source Code

Facebook Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.