|
See the below link
Link
there is Limit clause in MS SQL
|
|
|
|
|
|
Thanks man
|
|
|
|
|
Hi Guys,is there any silverlight-wcf expert in this forum?Please visit the silverlight message board and reply to the first message titled "Silverlight WCF issue"...plz plz plz...It seems very few people visit that message board.
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
hi,
I want to develop an application to remaind me to fill timesheet everyday.
Please can guide me how to develop this application.
But i am planning to develope this application using Dotnet technology.
|
|
|
|
|
Are you planning to use ASP.NET aor windows application?Its better if you use Windows one.
|
|
|
|
|
you can develop an windows application which shows a messagebox in the form load reminding u of filling up the timesheet.And schedule that application using windows scheduler at your desired time.
<font style="color:Green;font-family:Courier New;font-weight:bold;">C</font><font style="color:Blue;font-family:Courier New;font-weight:bold;">C</font><font style="color:Pink;font-family:Courier New;font-weight:bold;">26</font>
|
|
|
|
|
Second person.... Hey u guys first try yourself and then ask the problems occured during the development....Just try...
|
|
|
|
|
How To Move PDF Up & Down by mouse which is in Iframe
|
|
|
|
|
|
Hi Sir,
I want to add an facility to my application that if a user is login with user id Admin from pc-1 and then at the same time another user is login with same user id Admin from pc-2 then user on pc-1 should be log out and should have a message "You Have Been Signed Out.As Another User Has Signed In With Your UserID".
please help me.
one more issue is that if user does not logout and directly close the browser then user should be logout.
|
|
|
|
|
One way to do implement this functionality, that whenever a user login make an entry in DB as a loggedin user, once another user try to login with same user, allow to him for login but at the same remove the netry fro first user, and on evry postback check from whether the user has entry in db, if not then make him logout.
Its better I think if a user has logged in from one pc then dont allow from other pc , just show a message a user has already loggedin.
|
|
|
|
|
Brij wrote: Its better I think if a user has logged in from one pc then dont allow from other pc , just show a message a user has already loggedin.
Yes I am agree with you brij. Other wise its unnecessary hitting of DB on every post back which impact badly on performance.
Cheers !
Abhijit Jana | MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi sir,
if you never mind sir.i want your yahoo id
thank you very much sir.
|
|
|
|
|
|
And I think this is quite well known problem for us ... ..
Account Locked :
Cheers !
Abhijit Jana | MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
yes
|
|
|
|
|
yes sir,
you both are absolutely right.but please suggest me where i am wrong in my second post.
and give your suggestion for this.
thanks
|
|
|
|
|
thank u sir,
i was doing the same as you are saying.and i am entering browser name also in my loginentry table(temp table).
so that suppose if user login from ie browser and now he opens new ie and enter login page of application then user should not have login page because user has logged in once and it shows direct user home page.but if he enter login url in mozilla or any other browser then he should have login page.
but at the same time if i am opening my login page from another system then again user home page is displaying.but it should be login page.
|
|
|
|
|
Are you checking session variable properly ?
Cheers !
Abhijit Jana | MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
yes sir,
actually i am sending you my code behind. please consider this.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Login_Bl;
using message;
using General_Bal;
using ChecknetConnection;
[Serializable]
public partial class Default : System.Web.UI.Page
{
LoginBl objloginbl = new LoginBl();
GeneralBal objgeneral = new GeneralBal();
public static DataSet usr_val = new DataSet();
public static DataSet usr_val_usr = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
txtUserId.Focus();
if (Session["loginfailed"].ToString() == "1" )
{
WebMsgBox.Show("You Have Been Signed Out.As Another User Has Signed In With Your UserID");
}
string ses = Session.SessionID;
if (usr_val.Tables.Count > 0)
{
if (usr_val.Tables[0].Rows.Count > 0)
{
string sess = usr_val.Tables[0].Rows[0]["sessionid"].ToString();
string expl = usr_val.Tables[0].Rows[0]["explorer"].ToString();
HttpBrowserCapabilities bro = new HttpBrowserCapabilities();
bro = Request.Browser;
if (bro.Browser.ToString() == expl.ToString())
{
Session["Roles"] = "Admin";
Session["customer"] = usr_val.Tables[0].Rows[0]["userid"].ToString();
Session["sessionid"] = usr_val.Tables[0].Rows[0]["sessionid"].ToString();
Response.Redirect("Admin/AdminHome.aspx");
}
}
}
if (usr_val_usr.Tables.Count > 0)
{
if (usr_val_usr.Tables[0].Rows.Count > 0)
{
string sess = usr_val_usr.Tables[0].Rows[0]["sessionid"].ToString();
string expl = usr_val.Tables[0].Rows[0]["explorer"].ToString();
HttpBrowserCapabilities bro = new HttpBrowserCapabilities();
bro = Request.Browser;
if (bro.Browser.ToString() == expl.ToString())
{
Session["Roles"] = "User";
Session["customer"] = usr_val_usr.Tables[0].Rows[0]["userid"].ToString();
Session["sessionid"] = usr_val_usr.Tables[0].Rows[0]["sessionid"].ToString();
Response.Redirect("User/UserHome.aspx");
}
}
}
}
protected void btnLogIn_Click(object sender, EventArgs e)
{
objloginbl.User = txtUserId.Text;
objloginbl.Password = txtPassword.Text;
if (objloginbl.User == "Admin" && objloginbl.Password == "administrator")
{
Session["Roles"] = "Admin";
Session["customer"] = txtUserId.Text;
string t11;
t11 = Session.SessionID;
objloginbl.SessionId = t11;
DataSet ds = new DataSet();
ds = objgeneral.GetCurrentDate();
objloginbl.UserDate = Convert.ToDateTime(ds.Tables[0].Rows[0]["date"].ToString());
DataSet usr = new DataSet();
usr = objloginbl.chksess(objloginbl);
if (usr.Tables[0].Rows.Count > 0)
{
string cust = usr.Tables[0].Rows[0]["userid"].ToString();
string sess = usr.Tables[0].Rows[0]["sessionid"].ToString();
LoginBl objloginbal = new LoginBl();
objloginbal.User = cust;
objloginbal.SessionId = sess;
int t = objloginbal.deluser(objloginbal);
}
objloginbl.User = txtUserId.Text;
Session["sessionid"] = t11;
HttpBrowserCapabilities brow = new HttpBrowserCapabilities();
brow = Request.Browser;
objloginbl.Explorer = brow.Browser.ToString ();
int t2 = objloginbl.insert_loginentry(objloginbl);
if (t2 > 0)
{
usr_val = objloginbl.chksess(objloginbl);
}
Response.Redirect("Admin/sellocation.aspx");
}
else
{
DataSet usr1 = new DataSet();
usr1 = objloginbl.user_validate(objloginbl);
if (usr1.Tables[0].Rows.Count > 0)
{
Session["Roles"] = usr1.Tables[0].Rows[0]["Role"].ToString();
Session["customer"] = txtUserId.Text;
string t11;
t11 = Session.SessionID;
objloginbl.SessionId = t11;
DataSet ds = new DataSet();
ds = objgeneral.GetCurrentDate();
objloginbl.UserDate = Convert.ToDateTime(ds.Tables[0].Rows[0]["date"].ToString());
DataSet usr = new DataSet();
usr = objloginbl.chksess(objloginbl);
if (usr.Tables[0].Rows.Count > 0)
{
string cust = usr.Tables[0].Rows[0]["userid"].ToString();
string sess = usr.Tables[0].Rows[0]["sessionid"].ToString();
LoginBl objloginbal = new LoginBl();
objloginbal.User = cust;
objloginbal.SessionId = sess;
int t = objloginbal.deluser(objloginbal);
if (t > 0)
{
}
}
Session["sessionid"] = t11;
objloginbl.User = txtUserId.Text;
objloginbl.Explorer = Request.Browser.ToString ();
int t2 = objloginbl.insert_loginentry(objloginbl);
if (t2 > 0)
{
usr_val_usr = objloginbl.chksess(objloginbl);
}
Response.Redirect("User/UserHome.aspx");
}
else
{
WebMsgBox.Show("Invalid User");
return;
}
}
}
}
|
|
|
|
|
vikas shukla wrote: but at the same time if i am opening my login page from another system then again user home page is displaying.but it should be login page.
You should also store the IP of the system along with the browser.So the you can check from which system user is trying to login.If request comes from another Ip then dont allow to be logged in.
To get the IP of the client system, you can get using srever variables as Request.ServerVariables["REMOTE_ADDR"]
|
|
|
|
|
thanks sir
i tried your suggestion.but problem was same.if i am login from pc1 and at the same time i am trying to login from another pc then both are working while according to my requirement second should be on login page.that means both ip of the system are same is it possible? on the page load i am doing this.
string ipaddress = Request.ServerVariables["REMOTE_ADDR"];
if (usr_val.Tables.Count > 0)
{
if (usr_val.Tables[0].Rows.Count > 0)
{
string ip = usr_val.Tables[0].Rows[0]["ipaddress"].ToString();
HttpBrowserCapabilities bro = new HttpBrowserCapabilities();
bro = Request.Browser;
if(ip==ipaddress )
{
if (bro.Browser.ToString() == expl.ToString())
{
Session["Roles"] = "Admin";
Session["customer"] = usr_val.Tables[0].Rows[0]["userid"].ToString();
Session["sessionid"] = usr_val.Tables[0].Rows[0]["sessionid"].ToString();
Response.Redirect("Admin/AdminHome.aspx");
}
}
}
}
is there another way for take the ip of client system?
|
|
|
|
|
hi sir,
please try to understand my problem.and me some help.i am waiting for your help.
thanks
|
|
|
|
|
I have used urlrewiter in my project for the menu links which is coming in all pages.When th links are clicked from http:// url pages it works fine as
http://localhost/Sections/flat-panel-displays-222
but when the menu links are clicked from https:// url pages it comes as
http://localhost/Products.aspx?CategoryName=flat-panel-displays&CategoryId=222
what i have given for processing in background.
|
|
|
|