15,902,884 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by apjitin (Top 6 by date)
apjitin
19-Apr-13 2:10am
View
Thanks guys for all your responses.I found the silly mistake i was doing...Thanks again... :)
apjitin
19-Apr-13 1:59am
View
Here is the rough implementaion of the code...I am using Sqldatasource to retrieve contents from a table and displaying the contenets using a Gridview.I am maintaing a session variable also.
protected void Page_Load(object sender, EventArgs e)
{
string quarter = Session["quar"].ToString();
string projectid = (string)Session["projid"];
string User = (String)Session["username"];
string role = (String)Session["role"];
Session["Portname"] = Portinfo.Getportname();
Session["Portcode"] = Portinfo.Getportcode();
string pc = (string)Session["Portcode"];
userlbl.Text = User;
rolelbl.Text = role;
}
<asp:SqlDataSource ID="capitalrpts" runat="server"
ConnectionString="<%ConnectionStrings:userdatabase %>"
SelectCommand="SELECT Month,Proj_Id FROM MDMonthlyDetails JOIN Portinfo ON Portinfo.Portcode=MDMonthlyDetails.Portcode
WHERE MDMonthlyDetails.Portcode=@pc">
<SelectParameters>
<asp:SessionParameter Name="pc" SessionField="Portcode" />
</SelectParameters>
<asp:GridView ID="GridView1" DataSourceID="capitalrpts" runat="server">
apjitin
14-Mar-13 11:19am
View
i am using sqldatasource..and different users may be like user1,user2 and so on...
here is the code..
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
string User = (String)Session["username"];
string role = (String)Session["role"];
userlbl.Text = User;
rolelbl.Text = role;
</script>
<asp:DetailsView ID="dtlview" EmptyDataText="No projects" runat="server" DataSourceID="srcusers" Height="50px" Width="125px">
<asp:SqlDataSource ID="srcusers" ConnectionString="<%ConnectionStrings:userdatabase %>"
runat="server"
SelectCommand="Select Portname,workdone,Description,dateofissue,dateofcompletion,Cost from Cmpl_Proj JOIN Portinfo ON Portinfo.Portcode=Cmpl_Proj.Portcode where Portinfo.Portmanager=@User">
apjitin
8-Mar-13 23:48pm
View
yeah...it worked...thnx again...
apjitin
8-Mar-13 1:28am
View
This is only rough.Please help me out.
protected void Page_Load(object sender, EventArgs e)
{
string user=Userverify.GetUser(username);
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["userdatabase"].ConnectionString);
string command = "Select Portcode,Portname Userinfo.Username from Portinfo JOIN Userinfo ON Userinfo.Portcode=Portinfo.Portcode where Username=user";
SqlCommand cmd = new SqlCommand(command,con);
con.Open();
SqlDataAdapter dad = new SqlDataAdapter(cmd);
res = new DataTable();
dad.Fill(res);
while (res.Rows.Count==1)
{
tpc.Text = res.Rows[0]["Portcode"].ToString();
tpn.Text = res.Rows[0]["Portname"].ToString();
}
con.Close();
}
apjitin
8-Mar-13 1:26am
View
Thanx for your post.I am almost there but i would be using JOIN in my query and how to collect session of user
Show More