P
Patrick Sullivan
I have a view of 3 tables joined with IDs named "appsvw" I can't get it to
display in my datagrid1. code is below. TIA.
Protected Const CONNECTION_STRING As String = _
"Server=localhost;" & _
"DataBase=Jsearch;" & _
"Integrated Security=SSPI;Connect Timeout=5"
Private ConnectionString As String = CONNECTION_STRING
Private tdsdata As DataSet1
Private Sub AppsForm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim con As New SqlConnection(ConnectionString)
tdsdata = New DataSet1
Dim adapter As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM
appsvw", con)
con.Open()
adapter.Fill(tdsdata)
con.Close()
DataGrid1.DataSource = tdsdata
DataGrid1.DataMember = "appsvw"
End Sub
viewtable creation
CREATE VIEW dbo.appsvw AS
SELECT TOP 1000 dbo.Positions.posName AS [Position], dbo.Companies.compName
AS Company, dbo.Applications.appDate AS [Date],
dbo.Applications.appNotes AS Notes,
dbo.Applications.appID AS ID
FROM
dbo.Companies INNER JOIN
dbo.Applications ON
dbo.Companies.compID = dbo.Applications.appCompany INNER JOIN
dbo.Positions ON
dbo.Applications.appPosition = dbo.Positions.posID
ORDER BY dbo.Applications.appID
TIA
display in my datagrid1. code is below. TIA.
Protected Const CONNECTION_STRING As String = _
"Server=localhost;" & _
"DataBase=Jsearch;" & _
"Integrated Security=SSPI;Connect Timeout=5"
Private ConnectionString As String = CONNECTION_STRING
Private tdsdata As DataSet1
Private Sub AppsForm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim con As New SqlConnection(ConnectionString)
tdsdata = New DataSet1
Dim adapter As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM
appsvw", con)
con.Open()
adapter.Fill(tdsdata)
con.Close()
DataGrid1.DataSource = tdsdata
DataGrid1.DataMember = "appsvw"
End Sub
viewtable creation
CREATE VIEW dbo.appsvw AS
SELECT TOP 1000 dbo.Positions.posName AS [Position], dbo.Companies.compName
AS Company, dbo.Applications.appDate AS [Date],
dbo.Applications.appNotes AS Notes,
dbo.Applications.appID AS ID
FROM
dbo.Companies INNER JOIN
dbo.Applications ON
dbo.Companies.compID = dbo.Applications.appCompany INNER JOIN
dbo.Positions ON
dbo.Applications.appPosition = dbo.Positions.posID
ORDER BY dbo.Applications.appID
TIA