Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Source code for Grid view:
ASP.NET
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" 
                        GridLines="None" Width="814px">
                        <rowstyle backcolor="#FFFBD6" forecolor="#333333" />
                        <columns>
                            <asp:BoundField DataField="group_id" HeaderText="group_id" 
                                SortExpression="group_id" />
                            <asp:BoundField DataField="chit_amount" HeaderText="chit_amount" 
                                SortExpression="chit_amount" />
                            <asp:BoundField DataField="member_id" HeaderText="member_id" 
                                SortExpression="member_id" />
                            <asp:BoundField DataField="sales_officer" HeaderText="sales_officer" 
                                SortExpression="sales_officer" />
                            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
                            <asp:BoundField DataField="agent" HeaderText="agent" SortExpression="agent" />
                        </columns>
                        <footerstyle backcolor="#990000" font-bold="True" forecolor="White" />
                        <pagerstyle backcolor="#FFCC66" forecolor="#333333" horizontalalign="Center" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <alternatingrowstyle backcolor="White" />


Staff Table
agent_id	int	
designation	varchar(50)	Checked
name	        varchar(20)	Unchecked
mobile_no	varchar(20)	Unchecked
address	        varchar(50)	Unchecked
		Unchecked

Member Table:
group_id	varchar(20)	Unchecked
chit_amount	int	        Unchecked
member_id	varchar(20)	Unchecked
sales_officer	varchar(50)	Checked
agent	        varchar(50)	Checked
name	        varchar(20)	Unchecked
voter_id	varchar(10)	Unchecked
mobile_no	varchar(20)	Unchecked
address	        varchar(50)	Unchecked
permission	varchar(20)	Unchecked
final_bid	varchar(50)	Checked

I have two tables...
I have created agent in staff table and agent information is i.e agent name is added in member table(using drop down list) .. so now i want names under agent...
Now when i login as a agent then members belongs to that agent should be displayed through grid view.....
Posted
Updated 2-Apr-13 4:00am
v2
Comments
[no name] 2-Apr-13 6:06am    
Yes it is very easy you can do it using session and Query string as well
When member login store its UserName in session and when you get the data from the table use this session to retrieve
thats it....tel me if you need more help
Pavanmkulkarni 2-Apr-13 6:50am    
Here in my project i am having Admin Module,staff module and agent module.
In admin module admin creates agent , automatically generates ID, after that agent login as wel as along with his auto generated ID, and he could not login his name.he supposed to do his ID.
In staff module while creating or adding member,staff can able to see the belonging agent's name (Every member comes through agent only). here in agent module i want to see only that belonging members for a particular agent through a grid view!

Can i get a complete query for this issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900