This is a migrated thread and some comments may be shown as answers.

problem with tableadapter and gridview

0 Answers 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
tcl4p
Top achievements
Rank 1
tcl4p asked on 17 May 2010, 02:01 AM
Can anyone tell me what's wrong with the following code.  When it gets to the line of code
grdStations.DataSource = taStations.GetData(1) I get a run time error for a "login failure for User5" .  The tableadapter is a call to a stored procedure, and User5 has permissions to execute the procedure.  Any help would be appreciated.

Thanks
Tom

 Private Sub LoadStationGrid()
         Dim taStations As New stationsTableAdapters.GetStationsByDeptTableAdapter
        Dim dsTrucks As New stationsTableAdapters.TruckTableAdapter   

        grdStations.DataSource = taStations.GetData(1)

        Dim template As GridViewTemplate = New GridViewTemplate
        template.DataSource = dsTrucks.GetData()
        grdStations.MasterGridViewTemplate.ChildGridViewTemplates.Add(template)

        Dim relation As GridViewRelation = New GridViewRelation(grdStations.MasterGridViewTemplate)
        relation.ChildTemplate = template
        relation.RelationName = "StationTrucks"
        relation.ParentColumnNames.Add("sID")
        relation.ChildColumnNames.Add("StationID")
        grdStations.Relations.Add(relation)
        

    End Sub

No answers yet. Maybe you can help?

Tags
GridView
Asked by
tcl4p
Top achievements
Rank 1
Share this question
or