|
You could not even wait for 5 min before reposting the same question
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi there:
Am making a login page using xml to get username and possword i want before dataview rowfilter to make column case sensitive which is the password and the other field in sensitive which is the username. I Tried to make the column in dataview case sensitive but i did know how? Could any one help me with this.
|
|
|
|
|
I am not sure what exactly you want?
Could you post your code what you have done so far, so that some one can helpt you better.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
DataSet ds = new DataSet();
DataTable dt = new DataTable();
string xmlPath=Server.MapPath("/Database/Credential.xml");
ds.ReadXml(xmlPath);
dt=ds.Tables[0];
DataView dv = new DataView();
dt=ds.Tables[0];
dv = dt.DefaultView;
//dv.Table.Columns["password"].
//dv.Table.Columns["username"].Table.CaseSensitive = false;
string rowFilter = "username = '"+this.txtUsername.Text+"' And password = '"+txtPassword.Text+"'";
dv.RowFilter=rowFilter;
//dt=(DataTable)dv;
if(dv.ToTable().Rows.Count==1)
Response.Write("<script>alert('Meche el 7al');</script>");
I want to check for case sensitive password column only
|
|
|
|
|
khalil.kamel wrote: string rowFilter = "username = '"+this.txtUsername.Text+"' And password = '"+txtPassword.Text+"'";
dv.RowFilter=rowFilter;
Well, .Net expression has a very limited capabitlites and it does not do all the things which can be done by SQL(for eg distinct, case expressions etc). So, the answer is you can not do this with RowFilter.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Ok thanx anyways i found another way to do it:
and i would like to share it:
First in the XML file he usernames should be in upper case:
and since the data view is case sensitive i would check for the upper case of the username and check the password as it is
here is the code
DataSet ds = new DataSet();
DataTable dt = new DataTable();
string xmlPath=Server.MapPath("/Database/Credential.xml");
ds.ReadXml(xmlPath);
dt=ds.Tables[0];
DataView dv = new DataView();
dt=ds.Tables[0];
dv = dt.DefaultView;
//dv.Table.Columns["password"].
dv.Table.Columns["username"].Table.CaseSensitive = true;
string rowFilter = "username = '"+this.txtUsername.Text.ToUpper()+"' And password = '"+txtPassword.Text+"'";
dv.RowFilter=rowFilter;
//dt=(DataTable)dv;
if(dv.ToTable().Rows.Count==1)
{
Response.Write("<script language='javascript' > alert('Meche el 7al'); </script>");
}
|
|
|
|
|
And Sorry to tell you it can be done but it is inefficient regarding the performance issues.
How it could be done:
DataSet ds = new DataSet();
DataTable dt = new DataTable();
string xmlPath=Server.MapPath("/Database/Credential.xml");
ds.ReadXml(xmlPath);
dt=ds.Tables[0];
DataView dv = new DataView();
dt=ds.Tables[0];
dv = dt.DefaultView;
dv.Table.CaseSensitive = false;//Set dv to case insensitive
dv.RowFilter="username ='"+txtUsername.Text+"'";//check for username
if (dv.ToTable().Rows.Count==1)//Valid Username
{
dt=dv.ToTable();//here i get the row that has the valid username and with its password and put it in DT
dv=dt.DefaultView;//then i reset the dv to the new dt
dv.Table.CaseSensitive=true;then i change the dv table to case sensitive
dv.RowFilter="password ='"+txtPassword.Text+"'";then i check for the password
if(dv.ToTable().Rows.Count==1)//if it retireved a record this means a valid password
{
//Code todo when login
}
}
PS: You might refine the code for better performance but the code i did above is better regarding performance
Please Rate If It helped and same thing for the code above
|
|
|
|
|
Usually passwords are stored as binary data and not strings. This will fix your problem. Furthermore, if you store them in binary form you can just as easily store the hash plus a salt for security reasons instead of storing the password.
|
|
|
|
|
Hey everyone,
I have this simple financial budget-lines screen on which some budget line items may be branched to unknown levels, what control(s) would you use to design such screen??
I'm thinking maybe nested DataGridView?? If so then how can I do such a thing and still maintain good design.
Please advise.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Look into the infragistics treeview in outlook express mode.
Or the objectlistview right here on CP will give you a tree on the left column with nomal cells in the rest of the control
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You better Use nested repeater and the first cell in a repeater item row put a button that would view the repeater within
|
|
|
|
|
And a repeater is.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
see Advanced TreeView for .NET in cp
----------
Eric(M.M)
|
|
|
|
|
Now that looks like a cool control, pity the author does not seem to be supporting it!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
I'm not going to give you the answer but only because you put regions inside of methods.
|
|
|
|
|
What sort of answer is that, he can have regions inside a method (NOT), how about nested regions and regions from the middle of one method to the middle of another method. I must admit I have never seen regions used inside a method
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
i m getting bezier approximation of ink stroke using stroke.GetFlattenedBezierPoints()where method is get flattened points. i do not know whether the method is using quadratic bezier approximation or cubic bezier approximation. is it possible anyway to find out the method used by microsoft.
thanks
|
|
|
|
|
You can use Reflector to peak at the internals of this method.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I'm trying to build a pop-up graph in c# using this.NotifyIcon.BalloonTipShown but it doesn't execute in Windows 7 . Is there any alternative way to open a form when the user hovers the mouse over the icon and close the form when the mouse is moved away ?
Im using the code below
this.NotifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
this.NotifyIcon.BalloonTipText = "RapidNAS Warez Made Easy ...";
this.NotifyIcon.BalloonTipTitle = "RapidNAS";
this.NotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("NotifyIcon.Icon")));
this.NotifyIcon.Text = "RapidNAS Warez Made Easy ...";
this.NotifyIcon.Visible = true;
this.NotifyIcon.BalloonTipClosed += new System.EventHandler(this.HideGraph);
this.NotifyIcon.BalloonTipShown += new System.EventHandler(this.ShowGraph);
private void LaunchDownloadStatus(object sender, MouseEventArgs e)
{
Popup form = new Popup();
form.Show();
}
private void HideGraph(object sender, EventArgs e)
{
}
|
|
|
|
|
Hi,
I need to execute a xoml workflow periodically using windows service. can anyone give me solution for this.
|
|
|
|
|
I have a connectionstring that is a Application setting and not a user setting. I want the user to be able to change this, but the datasets seem to want an Application Setting. IS there a way to programmically change this setting?
|
|
|
|
|
Nevermind. I just changed it to a USER setting and went into each dataset and changed where it looked for the connection string
|
|
|
|
|
Hi.
How can I convert a XDocument variable to string ?
Using ToString() method is the true way ?
xDocument.ToString();
Thanks.
|
|
|
|