Click here to Skip to main content
15,936,517 members
Home / Discussions / C#
   

C#

 
GeneralRe: A simple form sizing problem Pin
zoroyster2-May-07 16:05
zoroyster2-May-07 16:05 
QuestionGraphics ..with c # Pin
mr jets2-May-07 14:27
mr jets2-May-07 14:27 
AnswerRe: Graphics ..with c # Pin
Christian Graus2-May-07 14:45
protectorChristian Graus2-May-07 14:45 
GeneralRe: Graphics ..with c # Pin
mr jets2-May-07 14:58
mr jets2-May-07 14:58 
GeneralRe: Graphics ..with c # Pin
Christian Graus2-May-07 15:28
protectorChristian Graus2-May-07 15:28 
QuestionHow to get a mini dump? Pin
Super Lloyd2-May-07 13:33
Super Lloyd2-May-07 13:33 
AnswerRe: How to get a mini dump? Pin
Super Lloyd2-May-07 17:20
Super Lloyd2-May-07 17:20 
QuestionSelect from another select statement to a repeater Pin
simsen2-May-07 11:28
simsen2-May-07 11:28 
Hi,

I have a big problem, I hope you can help me with.

What I want:
A forum where there is 3 columns Subject, AnswersCount, LastAnswer

I have one table with all the data. And two selects functions, where I on the first, get all Subjects for all questions, and on the second select get the Count for all answers on a specific question (with input quiestionId). Both functions works perfect, when I use them seperatly.

But I have to go through all rows in the first selection to find the Count

What shall I do to that?

The code I have now is:

The Repeater, where I want to put all data into:
<asp:repeater id="repDebatIndlaeg" runat="server">
<headertemplate>


Antal indlæg ialt:
<asp:label id="lblIndlaegIalt" runat="server" text="Label">



<itemtemplate>



<footertemplate>
Emne
Antal indlæg
Seneste indlæg


<asp:hyperlink id="lnkEmne" runat="server" text="<%# Eval("Overskrift") %>" navigateurl="<%# "~/Debat.aspx?id=" + Eval("DebatId") %>">
<asp:label id="lblAntalIndlaeg" runat="server" text="<%# Eval("DebatNr") %>">
<asp:label id="lblSenesteIndlaeg" runat="server" text="<%# Eval("Dato") %>">







The codebehind:

protected void Page_Load(object sender, EventArgs e)
{
DebatApi debatapi = new DebatApi();

if (!IsPostBack)
{
try
{
DataTable Debat = null;
if (debatapi.GetDebat(ref Debat) == Status.Success)
{
int tael = 0;

for (int i = 0; i < Debat.Rows.Count; i++)
{
tael = Convert.ToInt32(Debat.Rows[i]["DebatId"]);
DataTable DebatCount = null;

if (debatapi.GetCountAnswers(tael, ref DebatCount) == Status.Success)
{

}
}
repDebatIndlaeg.DataSource = Debat.DefaultView;
repDebatIndlaeg.DataBind();
}
}
catch
{
}
}

debatapi.Dispose();
}

What shall I put into here so I can write the output into the repeater:
if (debatapi.GetCountAnswers(tael, ref DebatCount) == Status.Success)
{

}

If it was a label outside an repeater, I would make something like:

lblAntalIndlaeg.Text = Convert.ToInt32(GetKontoplanFuld.Rows[i]["DebatNr"]);

But VS cann't finde the lblAntalIndlaeg Frown | :-(

I hope someone can help me....Im pretty desperat....

Kind regards,
simsen Smile | :)
QuestionHow can I have my Cursor visiable? Pin
Khoramdin2-May-07 11:26
Khoramdin2-May-07 11:26 
AnswerRe: How can I have my Cursor visiable? Pin
AFSEKI7-May-07 5:56
AFSEKI7-May-07 5:56 
QuestionUpdate() database from DataSet Pin
aecordoba2-May-07 10:58
aecordoba2-May-07 10:58 
AnswerRe: Update() database from DataSet Pin
Paul Conrad2-May-07 11:03
professionalPaul Conrad2-May-07 11:03 
GeneralRe: Update() database from DataSet Pin
Giorgi Dalakishvili2-May-07 11:11
mentorGiorgi Dalakishvili2-May-07 11:11 
GeneralRe: Update() database from DataSet Pin
aecordoba2-May-07 12:52
aecordoba2-May-07 12:52 
GeneralRe: Update() database from DataSet Pin
PIEBALDconsult2-May-07 11:19
mvePIEBALDconsult2-May-07 11:19 
GeneralRe: Update() database from DataSet Pin
Paul Conrad2-May-07 11:26
professionalPaul Conrad2-May-07 11:26 
GeneralRe: Update() database from DataSet Pin
PIEBALDconsult2-May-07 11:43
mvePIEBALDconsult2-May-07 11:43 
GeneralRe: Update() database from DataSet Pin
Paul Conrad2-May-07 11:49
professionalPaul Conrad2-May-07 11:49 
GeneralRe: Update() database from DataSet Pin
Dave Kreskowiak2-May-07 16:18
mveDave Kreskowiak2-May-07 16:18 
GeneralRe: Update() database from DataSet Pin
PIEBALDconsult2-May-07 20:04
mvePIEBALDconsult2-May-07 20:04 
GeneralRe: Update() database from DataSet Pin
Dave Kreskowiak3-May-07 13:26
mveDave Kreskowiak3-May-07 13:26 
GeneralRe: Update() database from DataSet Pin
PIEBALDconsult4-May-07 16:58
mvePIEBALDconsult4-May-07 16:58 
GeneralRe: Update() database from DataSet Pin
Dave Kreskowiak5-May-07 3:32
mveDave Kreskowiak5-May-07 3:32 
GeneralRe: Update() database from DataSet Pin
PIEBALDconsult5-May-07 3:59
mvePIEBALDconsult5-May-07 3:59 
GeneralRe: Update() database from DataSet Pin
Dave Kreskowiak5-May-07 18:04
mveDave Kreskowiak5-May-07 18:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.