473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DataRelation Collection Problem and Repeater

Hi everyone,

This problem is making me old. I don't want to get any older.

I have a multi-nested repeater control as follows:

<asp:Repeater ID="clubRep1" Runat="server">
<HeaderTemplate><table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td></td>
<td><asp:Repeater ID="clubRep2" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>'
Runat="server" >
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Repeater ID="clubRep3" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server" >
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
Testing
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
The following is the codebehind:

public class PromoPosters : System.Web.UI.UserControl
{
protected System.Data.SqlClient.SqlConnection clubconn;
protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
protected System.Data.SqlClient.SqlCommand clubcmd;
protected System.Data.SqlClient.SqlCommand clubcmdimg;
protected System.Data.DataSet dsClub2;
protected System.Data.DataRow drClub;
protected System.Web.UI.WebControls.Repeater clubRep1;
protected System.Web.UI.WebControls.Repeater clubRep2;
protected System.Data.DataView dView;

private void Page_Load(object sender, System.EventArgs e)
{
string strclubconn=ConfigurationSettings.AppSettings["ConnectionString"];
clubconn=new SqlConnection(strclubconn);
clubconn.Open();
dsClub2=new DataSet();
string strPromotitle="SELECT Section_Tbl.*" +
"FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
Request.QueryString["PageID"] + "'";
string stringPromoSData="SELECT SectionData.* FROM SectionData";
string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
img_tbl.DateUpload Desc";

// Fill Dataset with necessary DataTables.
clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
clubadapt1.Fill(dsClub2,"Section");
clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn);
clubadapt1.Fill(dsClub2,"Data");
clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
clubadapt1.Fill(dsClub2,"imgs");
clubconn.Close();

if(!IsPostBack)
{
dsClub2.Relations.Add("Section_Data",
dsClub2.Tables["Section"].Columns["SectionID"],
dsClub2.Tables["Data"].Columns["SectionID"]);

dsClub2.Relations.Add("DataFK",
dsClub2.Tables["Data"].Columns["DataID"],
dsClub2.Tables["imgs"].Columns["DataID"]);

clubRep1.DataSource=dsClub2;
clubRep1.DataBind();
}
}

I don't know why but I keep getting a cast error as follows:

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error:
Line 22: <ItemTemplate>
Line 23: <tr>
Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server" >
Line 25: <HeaderTemplate>
Line 26: </HeaderTemplate>
Can someone please help me figure out why DataRowView is not the right cast
or what the problem could be if that isn't the problem. Please please

Sam-
Nov 19 '05 #1
8 2884
Did you read my answer to your other post about this? did it not help..you
don't seem to be doing what I suggested you try...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hi everyone,

This problem is making me old. I don't want to get any older.

I have a multi-nested repeater control as follows:

<asp:Repeater ID="clubRep1" Runat="server">
<HeaderTemplate><table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td></td>
<td><asp:Repeater ID="clubRep2" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>'
Runat="server" >
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Repeater ID="clubRep3" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server" >
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
Testing
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
The following is the codebehind:

public class PromoPosters : System.Web.UI.UserControl
{
protected System.Data.SqlClient.SqlConnection clubconn;
protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
protected System.Data.SqlClient.SqlCommand clubcmd;
protected System.Data.SqlClient.SqlCommand clubcmdimg;
protected System.Data.DataSet dsClub2;
protected System.Data.DataRow drClub;
protected System.Web.UI.WebControls.Repeater clubRep1;
protected System.Web.UI.WebControls.Repeater clubRep2;
protected System.Data.DataView dView;

private void Page_Load(object sender, System.EventArgs e)
{
string strclubconn=ConfigurationSettings.AppSettings["ConnectionString"];
clubconn=new SqlConnection(strclubconn);
clubconn.Open();
dsClub2=new DataSet();
string strPromotitle="SELECT Section_Tbl.*" +
"FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
Request.QueryString["PageID"] + "'";
string stringPromoSData="SELECT SectionData.* FROM SectionData";
string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
img_tbl.DateUpload Desc";

// Fill Dataset with necessary DataTables.
clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
clubadapt1.Fill(dsClub2,"Section");
clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn);
clubadapt1.Fill(dsClub2,"Data");
clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
clubadapt1.Fill(dsClub2,"imgs");
clubconn.Close();

if(!IsPostBack)
{
dsClub2.Relations.Add("Section_Data",
dsClub2.Tables["Section"].Columns["SectionID"],
dsClub2.Tables["Data"].Columns["SectionID"]);

dsClub2.Relations.Add("DataFK",
dsClub2.Tables["Data"].Columns["DataID"],
dsClub2.Tables["imgs"].Columns["DataID"]);

clubRep1.DataSource=dsClub2;
clubRep1.DataBind();
}
}

I don't know why but I keep getting a cast error as follows:

Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 22: <ItemTemplate>
Line 23: <tr>
Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server" >
Line 25: <HeaderTemplate>
Line 26: </HeaderTemplate>
Can someone please help me figure out why DataRowView is not the right cast or what the problem could be if that isn't the problem. Please please

Sam-

Nov 19 '05 #2
Hi Karl,

I did try your suggestion but I got the same error message regarding cast.

"Karl Seguin" wrote:
Did you read my answer to your other post about this? did it not help..you
don't seem to be doing what I suggested you try...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hi everyone,

This problem is making me old. I don't want to get any older.

I have a multi-nested repeater control as follows:

<asp:Repeater ID="clubRep1" Runat="server">
<HeaderTemplate><table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td></td>
<td><asp:Repeater ID="clubRep2" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>'
Runat="server" >
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Repeater ID="clubRep3" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server" >
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
Testing
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
The following is the codebehind:

public class PromoPosters : System.Web.UI.UserControl
{
protected System.Data.SqlClient.SqlConnection clubconn;
protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
protected System.Data.SqlClient.SqlCommand clubcmd;
protected System.Data.SqlClient.SqlCommand clubcmdimg;
protected System.Data.DataSet dsClub2;
protected System.Data.DataRow drClub;
protected System.Web.UI.WebControls.Repeater clubRep1;
protected System.Web.UI.WebControls.Repeater clubRep2;
protected System.Data.DataView dView;

private void Page_Load(object sender, System.EventArgs e)
{
string strclubconn=ConfigurationSettings.AppSettings["ConnectionString"];
clubconn=new SqlConnection(strclubconn);
clubconn.Open();
dsClub2=new DataSet();
string strPromotitle="SELECT Section_Tbl.*" +
"FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
Request.QueryString["PageID"] + "'";
string stringPromoSData="SELECT SectionData.* FROM SectionData";
string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
img_tbl.DateUpload Desc";

// Fill Dataset with necessary DataTables.
clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
clubadapt1.Fill(dsClub2,"Section");
clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn);
clubadapt1.Fill(dsClub2,"Data");
clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
clubadapt1.Fill(dsClub2,"imgs");
clubconn.Close();

if(!IsPostBack)
{
dsClub2.Relations.Add("Section_Data",
dsClub2.Tables["Section"].Columns["SectionID"],
dsClub2.Tables["Data"].Columns["SectionID"]);

dsClub2.Relations.Add("DataFK",
dsClub2.Tables["Data"].Columns["DataID"],
dsClub2.Tables["imgs"].Columns["DataID"]);

clubRep1.DataSource=dsClub2;
clubRep1.DataBind();
}
}

I don't know why but I keep getting a cast error as follows:

Exception Details: System.InvalidCastException: Specified cast is not

valid.

Source Error:
Line 22: <ItemTemplate>
Line 23: <tr>
Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server" >
Line 25: <HeaderTemplate>
Line 26: </HeaderTemplate>
Can someone please help me figure out why DataRowView is not the right

cast
or what the problem could be if that isn't the problem. Please please

Sam-


Nov 19 '05 #3
And when you cast it to DataRow instead?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
Hi Karl,

I did try your suggestion but I got the same error message regarding cast.

"Karl Seguin" wrote:
Did you read my answer to your other post about this? did it not help..you don't seem to be doing what I suggested you try...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hi everyone,

This problem is making me old. I don't want to get any older.

I have a multi-nested repeater control as follows:

<asp:Repeater ID="clubRep1" Runat="server">
<HeaderTemplate><table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td></td>
<td><asp:Repeater ID="clubRep2" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>'
Runat="server" >
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Repeater ID="clubRep3" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server" >
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
Testing
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
The following is the codebehind:

public class PromoPosters : System.Web.UI.UserControl
{
protected System.Data.SqlClient.SqlConnection clubconn;
protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
protected System.Data.SqlClient.SqlCommand clubcmd;
protected System.Data.SqlClient.SqlCommand clubcmdimg;
protected System.Data.DataSet dsClub2;
protected System.Data.DataRow drClub;
protected System.Web.UI.WebControls.Repeater clubRep1;
protected System.Web.UI.WebControls.Repeater clubRep2;
protected System.Data.DataView dView;

private void Page_Load(object sender, System.EventArgs e)
{
string strclubconn=ConfigurationSettings.AppSettings["ConnectionString"]; clubconn=new SqlConnection(strclubconn);
clubconn.Open();
dsClub2=new DataSet();
string strPromotitle="SELECT Section_Tbl.*" +
"FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
Request.QueryString["PageID"] + "'";
string stringPromoSData="SELECT SectionData.* FROM SectionData";
string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
img_tbl.DateUpload Desc";

// Fill Dataset with necessary DataTables.
clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
clubadapt1.Fill(dsClub2,"Section");
clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn);
clubadapt1.Fill(dsClub2,"Data");
clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
clubadapt1.Fill(dsClub2,"imgs");
clubconn.Close();

if(!IsPostBack)
{
dsClub2.Relations.Add("Section_Data",
dsClub2.Tables["Section"].Columns["SectionID"],
dsClub2.Tables["Data"].Columns["SectionID"]);

dsClub2.Relations.Add("DataFK",
dsClub2.Tables["Data"].Columns["DataID"],
dsClub2.Tables["imgs"].Columns["DataID"]);

clubRep1.DataSource=dsClub2;
clubRep1.DataBind();
}
}

I don't know why but I keep getting a cast error as follows:

Exception Details: System.InvalidCastException: Specified cast is not

valid.

Source Error:
Line 22: <ItemTemplate>
Line 23: <tr>
Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
Runat="server" >
Line 25: <HeaderTemplate>
Line 26: </HeaderTemplate>
Can someone please help me figure out why DataRowView is not the right

cast
or what the problem could be if that isn't the problem. Please please

Sam-


Nov 19 '05 #4
I get the following error message:

CS0117: 'System.Data.DataRow' does not contain a definition for
'CreateChildView'

making the repeater datasource as follows:
<%# ((DataRow)Container.DataItem).CreateChildView("Dat aFK")%>
If I type <%# ((DataRow)Container.DataItem).Rows.CreateChildView ("DataFK")%>
I get an error message saying that
System.Data.DataRow does not contain a definition for Rows.
"Karl Seguin" wrote:
And when you cast it to DataRow instead?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
Hi Karl,

I did try your suggestion but I got the same error message regarding cast.

"Karl Seguin" wrote:
Did you read my answer to your other post about this? did it not help..you don't seem to be doing what I suggested you try...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
> Hi everyone,
>
> This problem is making me old. I don't want to get any older.
>
> I have a multi-nested repeater control as follows:
>
> <asp:Repeater ID="clubRep1" Runat="server">
> <HeaderTemplate><table>
> </HeaderTemplate>
> <ItemTemplate>
> <tr>
> <td></td>
> <td><asp:Repeater ID="clubRep2" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>'
> Runat="server" >
> <HeaderTemplate>
> <table>
> </HeaderTemplate>
> <ItemTemplate>
> <tr>
> <td><asp:Repeater ID="clubRep3" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> Runat="server" >
> <HeaderTemplate>
> </HeaderTemplate>
> <ItemTemplate>
> Testing
> </ItemTemplate>
> <FooterTemplate>
> </FooterTemplate>
> </asp:Repeater></td>
> </tr>
> </ItemTemplate>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </asp:Repeater></td>
> </tr>
> </ItemTemplate>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </asp:Repeater>
> The following is the codebehind:
>
> public class PromoPosters : System.Web.UI.UserControl
> {
> protected System.Data.SqlClient.SqlConnection clubconn;
> protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
> protected System.Data.SqlClient.SqlCommand clubcmd;
> protected System.Data.SqlClient.SqlCommand clubcmdimg;
> protected System.Data.DataSet dsClub2;
> protected System.Data.DataRow drClub;
> protected System.Web.UI.WebControls.Repeater clubRep1;
> protected System.Web.UI.WebControls.Repeater clubRep2;
> protected System.Data.DataView dView;
>
> private void Page_Load(object sender, System.EventArgs e)
> {
> string strclubconn=ConfigurationSettings.AppSettings["ConnectionString"]; > clubconn=new SqlConnection(strclubconn);
> clubconn.Open();
> dsClub2=new DataSet();
> string strPromotitle="SELECT Section_Tbl.*" +
> "FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
> Request.QueryString["PageID"] + "'";
> string stringPromoSData="SELECT SectionData.* FROM SectionData";
> string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
> img_tbl.DateUpload Desc";
>
> // Fill Dataset with necessary DataTables.
> clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
> clubadapt1.Fill(dsClub2,"Section");
> clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn);
> clubadapt1.Fill(dsClub2,"Data");
> clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
> clubadapt1.Fill(dsClub2,"imgs");
> clubconn.Close();
>
> if(!IsPostBack)
> {
> dsClub2.Relations.Add("Section_Data",
> dsClub2.Tables["Section"].Columns["SectionID"],
> dsClub2.Tables["Data"].Columns["SectionID"]);
>
> dsClub2.Relations.Add("DataFK",
> dsClub2.Tables["Data"].Columns["DataID"],
> dsClub2.Tables["imgs"].Columns["DataID"]);
>
> clubRep1.DataSource=dsClub2;
> clubRep1.DataBind();
> }
> }
>
> I don't know why but I keep getting a cast error as follows:
>
> Exception Details: System.InvalidCastException: Specified cast is not
valid.
>
> Source Error:
>
>
> Line 22: <ItemTemplate>
> Line 23: <tr>
> Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> Runat="server" >
> Line 25: <HeaderTemplate>
> Line 26: </HeaderTemplate>
>
>
> Can someone please help me figure out why DataRowView is not the right
cast
> or what the problem could be if that isn't the problem. Please please
>
> Sam-


Nov 19 '05 #5
I get an error message stating that
System.Data.DataRow does not contain a definition for 'CreateChildView'
I typed the following:
<%# ((DataRow)Container.DataItem).CreateChildView("Dat aFK")%>
I also tried in the datasource <%#
((DataRow)Container.DataItem).Rows.CreateChildView ("DataFK")%>
and got a a similar error but instead of 'CreateChildView' the undefined
element was 'Rows'.

"Karl Seguin" wrote:
And when you cast it to DataRow instead?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
Hi Karl,

I did try your suggestion but I got the same error message regarding cast.

"Karl Seguin" wrote:
Did you read my answer to your other post about this? did it not help..you don't seem to be doing what I suggested you try...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
> Hi everyone,
>
> This problem is making me old. I don't want to get any older.
>
> I have a multi-nested repeater control as follows:
>
> <asp:Repeater ID="clubRep1" Runat="server">
> <HeaderTemplate><table>
> </HeaderTemplate>
> <ItemTemplate>
> <tr>
> <td></td>
> <td><asp:Repeater ID="clubRep2" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>'
> Runat="server" >
> <HeaderTemplate>
> <table>
> </HeaderTemplate>
> <ItemTemplate>
> <tr>
> <td><asp:Repeater ID="clubRep3" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> Runat="server" >
> <HeaderTemplate>
> </HeaderTemplate>
> <ItemTemplate>
> Testing
> </ItemTemplate>
> <FooterTemplate>
> </FooterTemplate>
> </asp:Repeater></td>
> </tr>
> </ItemTemplate>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </asp:Repeater></td>
> </tr>
> </ItemTemplate>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </asp:Repeater>
> The following is the codebehind:
>
> public class PromoPosters : System.Web.UI.UserControl
> {
> protected System.Data.SqlClient.SqlConnection clubconn;
> protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
> protected System.Data.SqlClient.SqlCommand clubcmd;
> protected System.Data.SqlClient.SqlCommand clubcmdimg;
> protected System.Data.DataSet dsClub2;
> protected System.Data.DataRow drClub;
> protected System.Web.UI.WebControls.Repeater clubRep1;
> protected System.Web.UI.WebControls.Repeater clubRep2;
> protected System.Data.DataView dView;
>
> private void Page_Load(object sender, System.EventArgs e)
> {
> string strclubconn=ConfigurationSettings.AppSettings["ConnectionString"]; > clubconn=new SqlConnection(strclubconn);
> clubconn.Open();
> dsClub2=new DataSet();
> string strPromotitle="SELECT Section_Tbl.*" +
> "FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
> Request.QueryString["PageID"] + "'";
> string stringPromoSData="SELECT SectionData.* FROM SectionData";
> string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
> img_tbl.DateUpload Desc";
>
> // Fill Dataset with necessary DataTables.
> clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
> clubadapt1.Fill(dsClub2,"Section");
> clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn);
> clubadapt1.Fill(dsClub2,"Data");
> clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
> clubadapt1.Fill(dsClub2,"imgs");
> clubconn.Close();
>
> if(!IsPostBack)
> {
> dsClub2.Relations.Add("Section_Data",
> dsClub2.Tables["Section"].Columns["SectionID"],
> dsClub2.Tables["Data"].Columns["SectionID"]);
>
> dsClub2.Relations.Add("DataFK",
> dsClub2.Tables["Data"].Columns["DataID"],
> dsClub2.Tables["imgs"].Columns["DataID"]);
>
> clubRep1.DataSource=dsClub2;
> clubRep1.DataBind();
> }
> }
>
> I don't know why but I keep getting a cast error as follows:
>
> Exception Details: System.InvalidCastException: Specified cast is not
valid.
>
> Source Error:
>
>
> Line 22: <ItemTemplate>
> Line 23: <tr>
> Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> Runat="server" >
> Line 25: <HeaderTemplate>
> Line 26: </HeaderTemplate>
>
>
> Can someone please help me figure out why DataRowView is not the right
cast
> or what the problem could be if that isn't the problem. Please please
>
> Sam-


Nov 19 '05 #6
And when I cast to DataView I get a compiliation Error as follows:

CS0122: 'System.Data.DataView.CreateChildView(string, int)' is inaccessible
due to its protection level

This is truly killing me. Is there anyway I can alter the protection level
and exactly what protection level?

"Karl Seguin" wrote:
And when you cast it to DataRow instead?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
Hi Karl,

I did try your suggestion but I got the same error message regarding cast.

"Karl Seguin" wrote:
Did you read my answer to your other post about this? did it not help..you don't seem to be doing what I suggested you try...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
> Hi everyone,
>
> This problem is making me old. I don't want to get any older.
>
> I have a multi-nested repeater control as follows:
>
> <asp:Repeater ID="clubRep1" Runat="server">
> <HeaderTemplate><table>
> </HeaderTemplate>
> <ItemTemplate>
> <tr>
> <td></td>
> <td><asp:Repeater ID="clubRep2" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>'
> Runat="server" >
> <HeaderTemplate>
> <table>
> </HeaderTemplate>
> <ItemTemplate>
> <tr>
> <td><asp:Repeater ID="clubRep3" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> Runat="server" >
> <HeaderTemplate>
> </HeaderTemplate>
> <ItemTemplate>
> Testing
> </ItemTemplate>
> <FooterTemplate>
> </FooterTemplate>
> </asp:Repeater></td>
> </tr>
> </ItemTemplate>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </asp:Repeater></td>
> </tr>
> </ItemTemplate>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </asp:Repeater>
> The following is the codebehind:
>
> public class PromoPosters : System.Web.UI.UserControl
> {
> protected System.Data.SqlClient.SqlConnection clubconn;
> protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
> protected System.Data.SqlClient.SqlCommand clubcmd;
> protected System.Data.SqlClient.SqlCommand clubcmdimg;
> protected System.Data.DataSet dsClub2;
> protected System.Data.DataRow drClub;
> protected System.Web.UI.WebControls.Repeater clubRep1;
> protected System.Web.UI.WebControls.Repeater clubRep2;
> protected System.Data.DataView dView;
>
> private void Page_Load(object sender, System.EventArgs e)
> {
> string strclubconn=ConfigurationSettings.AppSettings["ConnectionString"]; > clubconn=new SqlConnection(strclubconn);
> clubconn.Open();
> dsClub2=new DataSet();
> string strPromotitle="SELECT Section_Tbl.*" +
> "FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
> Request.QueryString["PageID"] + "'";
> string stringPromoSData="SELECT SectionData.* FROM SectionData";
> string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
> img_tbl.DateUpload Desc";
>
> // Fill Dataset with necessary DataTables.
> clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
> clubadapt1.Fill(dsClub2,"Section");
> clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn);
> clubadapt1.Fill(dsClub2,"Data");
> clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
> clubadapt1.Fill(dsClub2,"imgs");
> clubconn.Close();
>
> if(!IsPostBack)
> {
> dsClub2.Relations.Add("Section_Data",
> dsClub2.Tables["Section"].Columns["SectionID"],
> dsClub2.Tables["Data"].Columns["SectionID"]);
>
> dsClub2.Relations.Add("DataFK",
> dsClub2.Tables["Data"].Columns["DataID"],
> dsClub2.Tables["imgs"].Columns["DataID"]);
>
> clubRep1.DataSource=dsClub2;
> clubRep1.DataBind();
> }
> }
>
> I don't know why but I keep getting a cast error as follows:
>
> Exception Details: System.InvalidCastException: Specified cast is not
valid.
>
> Source Error:
>
>
> Line 22: <ItemTemplate>
> Line 23: <tr>
> Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
> ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> Runat="server" >
> Line 25: <HeaderTemplate>
> Line 26: </HeaderTemplate>
>
>
> Can someone please help me figure out why DataRowView is not the right
cast
> or what the problem could be if that isn't the problem. Please please
>
> Sam-


Nov 19 '05 #7
I doubt anything is truly killing you. I think if you took the time to
understand what was going on you'd find that the solution isn't all that
complicated. I clearly haven't been very helpful to date, otherwise we'd
have this figured out by now, my apologies to that fact.

Having said that, when you bind a control to a dataset/datatable it's
actually the Default DataView which gets bound. As such, each row is a
DataRowView...this explains why you must cast e.Item.Data to the type
DataRowView. The DataRowView has a Row property which represents the actual
row it's 'viewing'

When you did:
((DataRowView)Container.DataItem).Row.GetChildRows

you were pretty much saying for the current DataRowView, get the underlying
row and then get all the child rows for the given relationship.

I belive this is where you are getting confused. The initial repeater is
getting bound to a DataView, hence the individual items are DataRowViews.
This inner repeater is getting bound to an array of rows. Hence, the
individual items are DataRow's, not DataRowViews. This is why you got the
initial cast error. As I tried to point out, there are two ways out of this
mess. You can either use the CreateChildView method of the DataRowView to
get another DataView instead of an array of rows...or you get cast the inner
repeater's DataItem to DataRow...you seem to have tried a combination of
both but never the right one....

If you still aren't following me, add an OnItemDataBound event to each
repeater (it can be the same method shared by all), add a breakpoint inside
an IF statement which checks for e.Item.ItemType == Item and see what type
e.Item.DataItem is...this will tell you exactly what type you need to cast
to.

Again, looking at your examples you've done two things:
- Cast the inner repeater's item to DataRowView when it should have been
DataRow
- Cast the inner repeater's item to DataRow (yay!) but then cast what that
repeater was being bound to to a DataView via CreateChildView (booo!)

In the 2nd attempt you did both things when you should have done one or the
other. Personally I would keep everything as DataRowView and use the
CreateChildView, instead or Row.GetChildRows()

Hope this helped.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
And when I cast to DataView I get a compiliation Error as follows:

CS0122: 'System.Data.DataView.CreateChildView(string, int)' is inaccessible due to its protection level

This is truly killing me. Is there anyway I can alter the protection level and exactly what protection level?

"Karl Seguin" wrote:
And when you cast it to DataRow instead?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
Hi Karl,

I did try your suggestion but I got the same error message regarding cast.
"Karl Seguin" wrote:

> Did you read my answer to your other post about this? did it not

help..you
> don't seem to be doing what I suggested you try...
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is

annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to > come!)
>
>
> "I am Sam" <Ia****@discussions.microsoft.com> wrote in message
> news:F4**********************************@microsof t.com...
> > Hi everyone,
> >
> > This problem is making me old. I don't want to get any older.
> >
> > I have a multi-nested repeater control as follows:
> >
> > <asp:Repeater ID="clubRep1" Runat="server">
> > <HeaderTemplate><table>
> > </HeaderTemplate>
> > <ItemTemplate>
> > <tr>
> > <td></td>
> > <td><asp:Repeater ID="clubRep2" DataSource='<%#
> > ((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>' > > Runat="server" >
> > <HeaderTemplate>
> > <table>
> > </HeaderTemplate>
> > <ItemTemplate>
> > <tr>
> > <td><asp:Repeater ID="clubRep3" DataSource='<%#
> > ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> > Runat="server" >
> > <HeaderTemplate>
> > </HeaderTemplate>
> > <ItemTemplate>
> > Testing
> > </ItemTemplate>
> > <FooterTemplate>
> > </FooterTemplate>
> > </asp:Repeater></td>
> > </tr>
> > </ItemTemplate>
> > <FooterTemplate>
> > </table>
> > </FooterTemplate>
> > </asp:Repeater></td>
> > </tr>
> > </ItemTemplate>
> > <FooterTemplate>
> > </table>
> > </FooterTemplate>
> > </asp:Repeater>
> > The following is the codebehind:
> >
> > public class PromoPosters : System.Web.UI.UserControl
> > {
> > protected System.Data.SqlClient.SqlConnection clubconn;
> > protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
> > protected System.Data.SqlClient.SqlCommand clubcmd;
> > protected System.Data.SqlClient.SqlCommand clubcmdimg;
> > protected System.Data.DataSet dsClub2;
> > protected System.Data.DataRow drClub;
> > protected System.Web.UI.WebControls.Repeater clubRep1;
> > protected System.Web.UI.WebControls.Repeater clubRep2;
> > protected System.Data.DataView dView;
> >
> > private void Page_Load(object sender, System.EventArgs e)
> > {
> > string

strclubconn=ConfigurationSettings.AppSettings["ConnectionString"];
> > clubconn=new SqlConnection(strclubconn);
> > clubconn.Open();
> > dsClub2=new DataSet();
> > string strPromotitle="SELECT Section_Tbl.*" +
> > "FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
> > Request.QueryString["PageID"] + "'";
> > string stringPromoSData="SELECT SectionData.* FROM SectionData";
> > string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
> > img_tbl.DateUpload Desc";
> >
> > // Fill Dataset with necessary DataTables.
> > clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
> > clubadapt1.Fill(dsClub2,"Section");
> > clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn); > > clubadapt1.Fill(dsClub2,"Data");
> > clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
> > clubadapt1.Fill(dsClub2,"imgs");
> > clubconn.Close();
> >
> > if(!IsPostBack)
> > {
> > dsClub2.Relations.Add("Section_Data",
> > dsClub2.Tables["Section"].Columns["SectionID"],
> > dsClub2.Tables["Data"].Columns["SectionID"]);
> >
> > dsClub2.Relations.Add("DataFK",
> > dsClub2.Tables["Data"].Columns["DataID"],
> > dsClub2.Tables["imgs"].Columns["DataID"]);
> >
> > clubRep1.DataSource=dsClub2;
> > clubRep1.DataBind();
> > }
> > }
> >
> > I don't know why but I keep getting a cast error as follows:
> >
> > Exception Details: System.InvalidCastException: Specified cast is not > valid.
> >
> > Source Error:
> >
> >
> > Line 22: <ItemTemplate>
> > Line 23: <tr>
> > Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
> > ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> > Runat="server" >
> > Line 25: <HeaderTemplate>
> > Line 26: </HeaderTemplate>
> >
> >
> > Can someone please help me figure out why DataRowView is not the right > cast
> > or what the problem could be if that isn't the problem. Please please > >
> > Sam-
>
>
>


Nov 19 '05 #8
Hey Karl;

It worked!!!! Thank you so much for your help. Your a good man.
"Karl Seguin" wrote:
I doubt anything is truly killing you. I think if you took the time to
understand what was going on you'd find that the solution isn't all that
complicated. I clearly haven't been very helpful to date, otherwise we'd
have this figured out by now, my apologies to that fact.

Having said that, when you bind a control to a dataset/datatable it's
actually the Default DataView which gets bound. As such, each row is a
DataRowView...this explains why you must cast e.Item.Data to the type
DataRowView. The DataRowView has a Row property which represents the actual
row it's 'viewing'

When you did:
((DataRowView)Container.DataItem).Row.GetChildRows

you were pretty much saying for the current DataRowView, get the underlying
row and then get all the child rows for the given relationship.

I belive this is where you are getting confused. The initial repeater is
getting bound to a DataView, hence the individual items are DataRowViews.
This inner repeater is getting bound to an array of rows. Hence, the
individual items are DataRow's, not DataRowViews. This is why you got the
initial cast error. As I tried to point out, there are two ways out of this
mess. You can either use the CreateChildView method of the DataRowView to
get another DataView instead of an array of rows...or you get cast the inner
repeater's DataItem to DataRow...you seem to have tried a combination of
both but never the right one....

If you still aren't following me, add an OnItemDataBound event to each
repeater (it can be the same method shared by all), add a breakpoint inside
an IF statement which checks for e.Item.ItemType == Item and see what type
e.Item.DataItem is...this will tell you exactly what type you need to cast
to.

Again, looking at your examples you've done two things:
- Cast the inner repeater's item to DataRowView when it should have been
DataRow
- Cast the inner repeater's item to DataRow (yay!) but then cast what that
repeater was being bound to to a DataView via CreateChildView (booo!)

In the 2nd attempt you did both things when you should have done one or the
other. Personally I would keep everything as DataRowView and use the
CreateChildView, instead or Row.GetChildRows()

Hope this helped.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
And when I cast to DataView I get a compiliation Error as follows:

CS0122: 'System.Data.DataView.CreateChildView(string, int)' is

inaccessible
due to its protection level

This is truly killing me. Is there anyway I can alter the protection

level
and exactly what protection level?

"Karl Seguin" wrote:
And when you cast it to DataRow instead?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"I am Sam" <Ia****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
> Hi Karl,
>
> I did try your suggestion but I got the same error message regarding cast. >
>
>
> "Karl Seguin" wrote:
>
> > Did you read my answer to your other post about this? did it not
help..you
> > don't seem to be doing what I suggested you try...
> >
> > Karl
> >
> > --
> > MY ASP.Net tutorials
> > http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
> > http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to > > come!)
> >
> >
> > "I am Sam" <Ia****@discussions.microsoft.com> wrote in message
> > news:F4**********************************@microsof t.com...
> > > Hi everyone,
> > >
> > > This problem is making me old. I don't want to get any older.
> > >
> > > I have a multi-nested repeater control as follows:
> > >
> > > <asp:Repeater ID="clubRep1" Runat="server">
> > > <HeaderTemplate><table>
> > > </HeaderTemplate>
> > > <ItemTemplate>
> > > <tr>
> > > <td></td>
> > > <td><asp:Repeater ID="clubRep2" DataSource='<%#
> > > ((DataRowView)Container.DataItem).Row.GetChildRows ("Section_Data")%>' > > > Runat="server" >
> > > <HeaderTemplate>
> > > <table>
> > > </HeaderTemplate>
> > > <ItemTemplate>
> > > <tr>
> > > <td><asp:Repeater ID="clubRep3" DataSource='<%#
> > > ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> > > Runat="server" >
> > > <HeaderTemplate>
> > > </HeaderTemplate>
> > > <ItemTemplate>
> > > Testing
> > > </ItemTemplate>
> > > <FooterTemplate>
> > > </FooterTemplate>
> > > </asp:Repeater></td>
> > > </tr>
> > > </ItemTemplate>
> > > <FooterTemplate>
> > > </table>
> > > </FooterTemplate>
> > > </asp:Repeater></td>
> > > </tr>
> > > </ItemTemplate>
> > > <FooterTemplate>
> > > </table>
> > > </FooterTemplate>
> > > </asp:Repeater>
> > > The following is the codebehind:
> > >
> > > public class PromoPosters : System.Web.UI.UserControl
> > > {
> > > protected System.Data.SqlClient.SqlConnection clubconn;
> > > protected System.Data.SqlClient.SqlDataAdapter clubadapt1;
> > > protected System.Data.SqlClient.SqlCommand clubcmd;
> > > protected System.Data.SqlClient.SqlCommand clubcmdimg;
> > > protected System.Data.DataSet dsClub2;
> > > protected System.Data.DataRow drClub;
> > > protected System.Web.UI.WebControls.Repeater clubRep1;
> > > protected System.Web.UI.WebControls.Repeater clubRep2;
> > > protected System.Data.DataView dView;
> > >
> > > private void Page_Load(object sender, System.EventArgs e)
> > > {
> > > string
strclubconn=ConfigurationSettings.AppSettings["ConnectionString"];
> > > clubconn=new SqlConnection(strclubconn);
> > > clubconn.Open();
> > > dsClub2=new DataSet();
> > > string strPromotitle="SELECT Section_Tbl.*" +
> > > "FROM Section_Tbl WHERE Section_Tbl.MenuID='" +
> > > Request.QueryString["PageID"] + "'";
> > > string stringPromoSData="SELECT SectionData.* FROM SectionData";
> > > string stringPromoImg="SELECT img_tbl.* FROM img_tbl ORDER BY
> > > img_tbl.DateUpload Desc";
> > >
> > > // Fill Dataset with necessary DataTables.
> > > clubadapt1=new SqlDataAdapter(strPromotitle,clubconn);
> > > clubadapt1.Fill(dsClub2,"Section");
> > > clubadapt1.SelectCommand=new SqlCommand(stringPromoSData,clubconn); > > > clubadapt1.Fill(dsClub2,"Data");
> > > clubadapt1.SelectCommand=new SqlCommand(stringPromoImg, clubconn);
> > > clubadapt1.Fill(dsClub2,"imgs");
> > > clubconn.Close();
> > >
> > > if(!IsPostBack)
> > > {
> > > dsClub2.Relations.Add("Section_Data",
> > > dsClub2.Tables["Section"].Columns["SectionID"],
> > > dsClub2.Tables["Data"].Columns["SectionID"]);
> > >
> > > dsClub2.Relations.Add("DataFK",
> > > dsClub2.Tables["Data"].Columns["DataID"],
> > > dsClub2.Tables["imgs"].Columns["DataID"]);
> > >
> > > clubRep1.DataSource=dsClub2;
> > > clubRep1.DataBind();
> > > }
> > > }
> > >
> > > I don't know why but I keep getting a cast error as follows:
> > >
> > > Exception Details: System.InvalidCastException: Specified cast is not > > valid.
> > >
> > > Source Error:
> > >
> > >
> > > Line 22: <ItemTemplate>
> > > Line 23: <tr>
> > > Line 24: <td><asp:Repeater ID="clubRep3" DataSource='<%#
> > > ((DataRowView)Container.DataItem).Row.GetChildRows ("DataFK")%>'
> > > Runat="server" >
> > > Line 25: <HeaderTemplate>
> > > Line 26: </HeaderTemplate>
> > >
> > >
> > > Can someone please help me figure out why DataRowView is not the right > > cast
> > > or what the problem could be if that isn't the problem. Please please > > >
> > > Sam-
> >
> >
> >


Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: serge calderara | last post by:
Dear all, I have an access database which is access by an application. From a remote PC using vb.net I am able to access to this database and collect necessary data. I need to make the remote...
1
by: yaser | last post by:
Hello: I need save my update but i can't :confused: :confused: :confused: look my code : Imports System.Data Imports System.Data.OleDb Public Class Form1
0
by: mazda_88 | last post by:
I have a number of tables inside a dataset. I have a repeater that I need to bind to. The data that is needed resides in two tables in the dataset. Here is the code that I'm using: Dim...
1
by: Weston Weems | last post by:
I've got a collection of objects say fruit. and fruit has a fairly decent heirachial structure not just flat props. I've got my repeater to bind to my fruit collection just fine, but what I want...
2
by: A Traveler | last post by:
Hi, I have a custom collection class i wrote, LineItemsCollection, which is a strongly typed collection of objects of my LineItem class. The LineItem class is a simple class with just a couple...
3
by: I am Sam | last post by:
I can relate two tables rather easily using the following code: dsClub.Relations.Add("Section_Data", dsClub.Tables.Columns, dsClub.Tables.Columns); Which connects the "Section" table to the...
2
by: Rich | last post by:
Hello, Following an example at http://www.vb-tips.com/dbpages.aspx?IA=DG (by Cor Lightert and Ken Tucker) on binding a dataRelation to a Datagridview for sqlClient, I was able to view rows...
0
by: Leon Mayne | last post by:
Could someone advise on what would be the best practice for the below problem? I am making a generalised search function which returns a record type (e.g. Employee, Department), the Id of the...
2
by: Tony Johansson | last post by:
Hello! I can't understand what is this table DataRelation used for. I mean as long as you have this DataTable I can't see any point in using this DataRelation. //Tony
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.