Quantcast
Viewing latest article 2
Browse Latest Browse All 9

reading data

1) filling data into a database from a database and showing it in a datagridview:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=753872&SiteID=1

2)

Dim theOleDbCommand as new OleDbCommand("SELECT * FROM [tableName]", new OleDbConnection(connectionStringHere))

theOleDbCommand.Connection.Open()

Dim theDataReader as OleDbDataReader = theOleDbCommand.ExecuteReader(CommandBehavior.CloseConnection)

while theDataReader.Read() = true

   MessageBox.Show(theDataReader("ColumnNameToReadValueFrom").ToString())

end while

theOleDbCommand.Connection.Close()

 

this will create a connection to the database and execute the command, in this case select all records from a table, and whilst there is data it will keep reading the data line by line (row by row technically) and show you the data in the specified column name in the DataReader Column array.


Viewing latest article 2
Browse Latest Browse All 9

Trending Articles