Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a datagrid
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00857342
Message ID:
00857964
Vues:
27
>Using the Northwind database, I'm trying to display the order records associated with the employee currently being displayed. For the first employee, EmployeeID=1, I should get 123 records.
>
>I'm still stuck on something...pardon me for being a newbie to VB... I followed an example from microsoft. The example worked. I tried doing what I saw in their example but I'm still missing something.
>
>According to the debugger, my dataset that I've associcated with my datagrid, has 123 records in it. However all I'm seeing in my datagrid are the column headings for the orders table.
>
>Any idea what I'm missing?
It's hard to tell without seeing your code, but here is a sample of (more or less) what you should have to bind data to a grid:
        Dim ConnString As String = "data source=(local);initial catalog=northwind;Integrated Security=SSPI"
        Dim Connection As New SqlConnection(ConnString)
        Dim GetData As New SqlCommand
        GetData.Connection = Connection
        GetData.CommandText = "select * from Employees"
        Dim da As New SqlDataAdapter(GetData)
        Dim ds As New DataSet
        da.Fill(ds, "Employee")
        Me.DataGrid1.DataMember = "Employee"
        Me.DataGrid1.DataSource = ds
Hector Correa
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform