Database-Contents into Textboxes ?!

  • Thread starter Thread starter Aurel
  • Start date Start date
A

Aurel

Guest
Due tu the help of the FAQ i used
Code:
       Dim strConnString As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=F:\Manfred\Fraktura\Fraktura.mdb"
        Dim sqlString As String = "SELECT * FROM Customer"

        'Connection object 
        Dim OleDbConnection As New System.Data.OleDb.OleDbConnection(strConnString)

        'Create data adapter object 
        Dim OleDbDataAdapter As New System.Data.OleDb.OleDbDataAdapter(sqlString, OleDbConnection)

        ' Create a dataset object and fill with data using data adapter's Fill method 

        Dim dataSet As New DataSet()
        OleDbDataAdapter.Fill(dataSet, "Kunden")
To connect to my database (although i dont know yet if this works)

and now, i have the problem, that i would like to show the information provided by the table (its an Adresslist)
in Textboxes and not in a datagrid or something like that :(

Any Idea ?
 
ok connection is working :)
but i still dont have any clue how i could insert text from a dataset into a textbox... :( :(
 
You have to load the dataset by code. I did it by using the assistent to create a Dataform. Then you see how it works and you can adapt the thing to your own project.
 
if its access itll work with

Visual Basic:
 data format
       data field
       datamember
       datasource

and so I think it also goes with other try searching the msdn
 
thx 2 you !
i found another solution *G*
My Solution:

Create a OleDBConnection, an OleDBDataApdapter and a DataSet.

To bring the contents of a database into a textbox, you will have just to set the property "DataBindings" from the textbox to the right collumn of your database :)


This is ok for a small database. For larger and more complicated it might be usefull to select and query the database manually, because you can define diferent querystrings more easier. ...
 
Back
Top