So, this is a bit of an update on an older post, but i've made progress and i'm stuck again.
Here's an addition.
So I found the master-details relationship, and currently, I have this...
Click on the details button on the master page and this is the code on the details page...
<%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
Dim SelectCmd As String = "select positiontitle, shift, openings" _
& "from jobs"
MyConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("PubsString"))
MyCommand = New SqlDataAdapter(SelectCmd, MyConnection)
MyCommand.SelectCommand.Parameters.Add(New SqlParameter("@Id", SqlDbType.NVarChar, 11))
MyCommand.SelectCommand.Parameters("@Id").Value = Request.QueryString("id")
DS = new DataSet()
Try
MyCommand.Fill(DS, "jobs")
MyDataGrid.DataSource = DS.Tables("jobs").DefaultView
MyDataGrid.DataBind()
Catch
End Try
End Sub
</script>
<html>
<head>
</head>
<body style="FONT: 10pt verdana">
<form runat="server">
<h3><font face="Verdana">Working with Master-Detail Relationships</font>
</h3>
<h4><font face="Verdana">Details for Job </font><%=Request.QueryString("id")%>
</h4>
<ASP
ataGrid id="MyDataGrid" runat="server" HeaderStyle-BackColor="#aaaadd" Font-Size="8pt" Font-Name="Verdana" CellPadding="3" BorderColor="Black" BackColor="#CCCCFF" Width="595px" Font-Names="Verdana">
<HeaderStyle backcolor="#AAAADD"></HeaderStyle>
</ASP
ataGrid>
</form>
</body>
</html>
Now it isn't working right, it is catching the querystring, so the ID is right, it'll tell me...
"Details for job (whatever it is the ID is)"
but then I get nothing, so the datagrid isn't catching the information, but I dont' know what's wrong...
Any help would be great, thanks.
Caden
Here's an addition.
So I found the master-details relationship, and currently, I have this...
Click on the details button on the master page and this is the code on the details page...
<%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
Dim SelectCmd As String = "select positiontitle, shift, openings" _
& "from jobs"
MyConnection = New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("PubsString"))
MyCommand = New SqlDataAdapter(SelectCmd, MyConnection)
MyCommand.SelectCommand.Parameters.Add(New SqlParameter("@Id", SqlDbType.NVarChar, 11))
MyCommand.SelectCommand.Parameters("@Id").Value = Request.QueryString("id")
DS = new DataSet()
Try
MyCommand.Fill(DS, "jobs")
MyDataGrid.DataSource = DS.Tables("jobs").DefaultView
MyDataGrid.DataBind()
Catch
End Try
End Sub
</script>
<html>
<head>
</head>
<body style="FONT: 10pt verdana">
<form runat="server">
<h3><font face="Verdana">Working with Master-Detail Relationships</font>
</h3>
<h4><font face="Verdana">Details for Job </font><%=Request.QueryString("id")%>
</h4>
<ASP
<HeaderStyle backcolor="#AAAADD"></HeaderStyle>
</ASP
</form>
</body>
</html>
Now it isn't working right, it is catching the querystring, so the ID is right, it'll tell me...
"Details for job (whatever it is the ID is)"
but then I get nothing, so the datagrid isn't catching the information, but I dont' know what's wrong...
Any help would be great, thanks.
Caden