Displaying Dataset Fill in a Datagrid

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Condor76

Thread Starter
Joined
Nov 11, 2005
Messages
17
Hi all,

I have this piece of code that fills a dataset. I would like to display it on the form in a datagrid. I added the datagrid unto my form but I'm not sure how to display the data. Any suggestions?

Here's my code.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim sConnString As String = "dsn=AS400.PPDRENTON.PACCAR.COM;" & _
"Uid=ATELLEZ;" & _
"Pwd=an30dres"

Dim ForecastingConn As New OdbcConnection(sConnString)

Dim selectCMD As OdbcCommand = New OdbcCommand("SELECT * FROM BGONE7.DLR_MSTR", ForecastingConn)
selectCMD.CommandTimeout = 30

Dim forecastingDA As OdbcDataAdapter = New OdbcDataAdapter
forecastingDA.SelectCommand = selectCMD

ForecastingConn.Open()

Dim forecastingDS As DataSet = New DataSet
forecastingDA.Fill(forecastingDS, "BGONE7.DLR_MSTR")

ForecastingConn.Close()
ForecastingConn.Dispose()
End Sub




Thanks,

Condor ;)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top