Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGridView & ODBC
 

DataGridView & ODBC

Hi all,

I often use DataGridView component to manage data in the database. It's very flexible, can copy to clipboard, allow run-time column-sorting and so on.

When I want to manage an access database - there's no problem, I add a new datasource to project, which is connected via OleDb to .mdb file, set up the DataGridView's datasource property to DataSet ...

But what if I need to bind the DataGridView to a table, which I've on SQL-server at work? I tried touse an ODBC access, but it's unknown for a project datasource.

Any idea how DGV can work through ODBC?

PS: I don't want the DataSet to connect directly to SQL-server's .mdf file! It isn't solution!

Thanx so far...

safety1001  Monday, February 13, 2006 12:06 PM
Make sure you have added a reference to System.Data.Odbc to your project references. You might also consider using the built in Sql provider, in the System.Data.Sql namespace.
CommonGenius.com  Monday, February 13, 2006 4:42 PM

In my project references I have System.Data reference and in "Imported namespaces" I have System.Data.Odbc checked.

But nothing changed, I can't bind my DGV via ODBC.

safety1001  Tuesday, February 14, 2006 9:18 AM

You can use google to search for other answers

Custom Search

More Threads

• DataGridView Keypress problem
• UPDATE ... SET ... WHERE ???
• add a data for every record
• Reading data from a column in datagridview
• Link or sharing BindingSources between forms
• Inserting new records using bindingnavigator and datagridview
• Combo box- How can I display two field from the table? (VB.net or VB visual studio 2005)
• Stange Problem with "binding and ComboBox"
• Right click event from a ListView item
• add and remove items between 2 listboxes