Click here to Skip to main content
16,004,977 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Pre_Init and Button_Click Pin
Ersan Ercek9-Aug-09 22:18
Ersan Ercek9-Aug-09 22:18 
GeneralRe: Pre_Init and Button_Click Pin
Ersan Ercek12-Aug-09 1:14
Ersan Ercek12-Aug-09 1:14 
QuestionSelective validation? Pin
Richard Blythe9-Aug-09 9:04
Richard Blythe9-Aug-09 9:04 
AnswerRe: Selective validation? Pin
Not Active9-Aug-09 9:12
mentorNot Active9-Aug-09 9:12 
GeneralRe: Selective validation? Pin
Richard Blythe9-Aug-09 13:10
Richard Blythe9-Aug-09 13:10 
GeneralRe: Selective validation? Pin
Not Active9-Aug-09 13:52
mentorNot Active9-Aug-09 13:52 
AnswerRe: Selective validation? Pin
Abhijit Jana9-Aug-09 10:30
professionalAbhijit Jana9-Aug-09 10:30 
Questionhow to get the count value for gridview from (sqlserver database)database [modified] Pin
priyamsc9-Aug-09 5:20
priyamsc9-Aug-09 5:20 
Hi,

I am doing forum project. I have a doubt, tat how to count the value. that is, all the data which displays in gridview. in tat i need to show the reply value [count the value from database].it means in database i hv field lke pid,pstreplyid,uid,tit,sub ...., in tat wen i create new msg it ll save in database giving pid automaticaly and in pstreplyid if its newmsg it creates 0 if its reply ten it takes pid value.

in gridview what i wud lke to display is, the reply value, if the pid(2) has 3 reply means, the field of reply shud show 3.

but i hv given query which displays only the new msg tat is pstreplyid=0.
i need to display new msg at the same time it should display the replyvalue also.

but i dnt knw how to count tat value so pls help me to do.
you just give me the suggestion to overcome the issue.

this is the gridview coding
============================
C#
page load()
{
 string k = "select *,(select uname from login where login.uid=thread.uid)as uname from thread where pstreplyid=0";
        adp = new SqlDataAdapter(k, con);
        DataSet ds = new DataSet();
        adp.Fill(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();
}

HTML
====
<asp:TemplateField HeaderText="Thread">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("tit") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
<                        
                        <asp:LinkButton ID="LinkButton1" runat="server" Text='<% # Eval("tit") %>' CommandName ="viewmsg" CommandArgument ='<%# DataBinder.Eval(Container.DataItem,"pid")%>' >LinkButton</asp:LinkButton>
                            <br />
                         <%#Eval("sub") %>                                            
                    </ItemTemplate>
 <asp:BoundField HeaderText="Replies" DataField="pstreplyid"/>
                <asp:BoundField DataField="pdate" HeaderText="Post Date" />
                <asp:BoundField DataField="rdate" HeaderText="Reply Date" />
                <asp:TemplateField HeaderText="Posted By">



Thank you in advance.

k.priya

modified on Sunday, August 9, 2009 12:08 PM

AnswerRe: how to get the count value for gridview from (sqlserver database)database Pin
Arindam Sinha9-Aug-09 7:02
Arindam Sinha9-Aug-09 7:02 
GeneralRe: how to get the count value for gridview from (sqlserver database)database Pin
priyamsc9-Aug-09 20:13
priyamsc9-Aug-09 20:13 
GeneralRe: how to get the count value for gridview from (sqlserver database)database Pin
Arindam Sinha9-Aug-09 22:27
Arindam Sinha9-Aug-09 22:27 
Questiongetting row index of a table in data source Pin
amarnath n.n9-Aug-09 1:24
amarnath n.n9-Aug-09 1:24 
AnswerRe: getting row index of a table in data source Pin
Abhijit Jana9-Aug-09 1:39
professionalAbhijit Jana9-Aug-09 1:39 
GeneralRe: getting row index of a table in data source Pin
amarnath n.n9-Aug-09 1:41
amarnath n.n9-Aug-09 1:41 
GeneralRe: getting row index of a table in data source Pin
amarnath n.n9-Aug-09 1:42
amarnath n.n9-Aug-09 1:42 
AnswerRe: getting row index of a table in data source Pin
Abhijit Jana9-Aug-09 1:58
professionalAbhijit Jana9-Aug-09 1:58 
GeneralRe: getting row index of a table in data source Pin
amarnath n.n9-Aug-09 2:16
amarnath n.n9-Aug-09 2:16 
GeneralRe: getting row index of a table in data source Pin
Arindam Sinha9-Aug-09 7:14
Arindam Sinha9-Aug-09 7:14 
QuestionPassing Array to javascript function from asp.net aspx.cs Pin
amarnath n.n9-Aug-09 0:28
amarnath n.n9-Aug-09 0:28 
AnswerRe: Passing Array to javascript function from asp.net aspx.cs Pin
Abhijit Jana9-Aug-09 0:40
professionalAbhijit Jana9-Aug-09 0:40 
Questionretrieving text from datalist Pin
Ersan Ercek8-Aug-09 10:13
Ersan Ercek8-Aug-09 10:13 
AnswerRe: retrieving text from datalist Pin
Abhijit Jana8-Aug-09 10:46
professionalAbhijit Jana8-Aug-09 10:46 
GeneralRe: retrieving text from datalist Pin
Ersan Ercek8-Aug-09 10:51
Ersan Ercek8-Aug-09 10:51 
GeneralRe: retrieving text from datalist Pin
Not Active8-Aug-09 11:07
mentorNot Active8-Aug-09 11:07 
QuestionDynamic Links Pin
Ersan Ercek8-Aug-09 7:59
Ersan Ercek8-Aug-09 7:59 

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.