How to link grid control with the database using oledbconnection?
i'm new in vb.net and i am having the problem as the topic stated.
i don have any source code for the connection because i really donno how to do. so i need help from someone here and help me out for my problem.
thank you.
Re: How to link grid control with the database using oledbconnection?
look at http://www.connectionstrings.com , has connections strings for all sorts of different types of providers
Re: How to link grid control with the database using oledbconnection?
Check out some of the tutorial links in my signature, as well as the 101 samples. You'll find plenty of ADO.NET stuff there.
Re: How to link grid control with the database using oledbconnection?
how you get a data from a database and place it in a text box.
what i mean is a row of data from a table.
Re: How to link grid control with the database using oledbconnection?
requires several items using ADO.NET, as JM said... best to read up on it so you understand it first before you try anything... using the links in his sig...
Re: How to link grid control with the database using oledbconnection?
Quote:
Originally Posted by gigemboy
Quote:
Originally Posted by jmcilhinney
Check out some of the tutorial links in my signature, as well as the 101 samples. You'll find plenty of ADO.NET stuff there.
Thanx ^^
Re: How to link grid control with the database using oledbconnection?
If you installed the documentation, there is a good intro article titled "Introduction to Data Access with ADO.NET", or you can search MSDN for that article as well...
**EDIT
For a more in depth article with full examples, check out the article "Accessing Data with ADO.NET"
Re: How to link grid control with the database using oledbconnection?
Quote:
Originally Posted by brian84
how you get a data from a database and place it in a text box.
what i mean is a row of data from a table.
We're not trying to be unhelpful, but giving bits of code when you don't understand the subject is like teaching someone who doesn't know how to drive how to turn left: it's great for that specific circumstance but it doesn't really help much overall. Your thread title says you want to link a grid to a database. The last step of that process is to assign a DataTable object to the DataSource property of either a DataGrid or DataGridView, depending on which version of VB.NET you're using. If you don't know how to populate the DataTable in the first place then you should take our advice and do some reading.
Re: How to link grid control with the database using oledbconnection?
The problem to connect the odbc with grid control had been solve but another problem occur again.
after i connect the odbc and grid control together, i tried to view the table from the dataadapter's preview data and i works when i click to fill the dataset.
but then i execute the code, the grid control do not show any data but oni the header and column name.
wat is the problem here..??
how can i show the data in the grid contorl..??
* i only use a dataset without datatable and dataview
*Problem solved
Re: How to link grid control with the database using oledbconnection?
i having another problem where i cannot update my data in the database/
it is update using a datagrid
i used the following code to update but it does not work.
anybody can help what i should do before this code and after the code
OleDbDataAdapter1.Update(DataSet1)
Re: How to link grid control with the database using oledbconnection?
You have to set the commandbuilder... it should automatically create the correct update commands when you call .update for general cases... sometimes this does not work if you are pulling data from multiple tables, etc...
VB Code:
Dim MyAdapter As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM " & strTable, strConn) 'just an example of an oledbdataadapter
Dim MyCmdBuilder As New System.Data.OleDb.OleDbCommandBuilder(MyAdapter) 'creates the commandbuilder
MyAdapter.Update(MyDataSet) 'update should now work now that the commandbuilder is set
Re: How to link grid control with the database using oledbconnection?
Just FYI, there is no such thing as a DataSet without a DataTable. A DateSet contains DataTables and DataRelations. It is the DataTable that contains the data, or more correctly that contains the DataRows that contain the data. If you are working with a single table of data and using a DataSet then you are adding an unnecessary layer of complexity. That's like creating an array that will only ever have one element.