Click here to Skip to main content
15,895,011 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Clearing javascript cache in IE7 Pin
gspiteri3-Apr-08 11:31
gspiteri3-Apr-08 11:31 
GeneralRe: Clearing javascript cache in IE7 Pin
Meg W7-Apr-08 8:03
Meg W7-Apr-08 8:03 
Questionthumbnail picture for shop catalouge [modified] Pin
Saba022-Apr-08 9:45
Saba022-Apr-08 9:45 
GeneralRe: thumbnail picture for shop catalouge Pin
Mark J. Miller2-Apr-08 10:01
Mark J. Miller2-Apr-08 10:01 
GeneralRe: thumbnail picture for shop catalouge Pin
Saba022-Apr-08 10:35
Saba022-Apr-08 10:35 
GeneralRequestSoapContext not found in proxy Pin
mpavas2-Apr-08 7:14
mpavas2-Apr-08 7:14 
QuestionHow do you Authenticate a User saved on SQL Server 2005?? Please Help. Pin
Etienne2-Apr-08 6:34
Etienne2-Apr-08 6:34 
GeneralRe: How do you Authenticate a User saved on SQL Server 2005?? Please Help. Pin
Mark J. Miller2-Apr-08 10:34
Mark J. Miller2-Apr-08 10:34 
Looks like you've encapsulated your database logic well enough that you should only need to update your queryRows method and your setConnectionString method. There isn't any difference in your code that you've posted. Lookup SqlConnection and SqlCommand for a good start on how to rewrite your methods.


Etienne wrote:
DBFunctions.queryRows("SELECT COUNT(Email) FROM Company WHERE Email = '" + uname + "' and Password = '" + password + "'")


As an aside, this is really bad practice for any application regardless of wither it's Access or SQL Server.

Instead you should do the following:
<br />
"SELECT COUNT(Email) FROM Company WHERE Email = @email and Password = @password"<br />


If you are using SQL Server pass this to the SqlCommand object. If you're using Access use OleDbCommand. Then regardless of the command object set the value of @email and @password using Parameters collection of the command object you create. You open yourself up to SQL Injection attacks otherwise.

Also, when you're updating data you're open to cross-site scripting attacks (XSS) unless you sanitize the data you get from the user using either Server.UrlEncode or Server.HtmlEncode. like this:

<br />
Dim email As String = Server.HtmlEncode(Request.Form("email"))<br />
<br />
' now you can pass your variable "email" to your SQL command<br />
<br />
<br />


I didn't see any examples of how you're updating data in your code above, but seeing your queries makes me think you aren't sanitizing your inputs either.

Sorry if the code samples don't compile, I haven't used VB in at least 6 years and I've never really used VB.NET.


GeneralFormsAuthentication and Session timeout problem. Pin
ESTAN2-Apr-08 6:28
ESTAN2-Apr-08 6:28 
GeneralRe: FormsAuthentication and Session timeout problem. Pin
Mark J. Miller2-Apr-08 10:50
Mark J. Miller2-Apr-08 10:50 
GeneralRe: FormsAuthentication and Session timeout problem. Pin
ESTAN3-Apr-08 22:49
ESTAN3-Apr-08 22:49 
GeneralRe: FormsAuthentication and Session timeout problem. Pin
Mark J. Miller4-Apr-08 4:34
Mark J. Miller4-Apr-08 4:34 
GeneralRe: FormsAuthentication and Session timeout problem. Pin
ESTAN8-Apr-08 2:20
ESTAN8-Apr-08 2:20 
Generalto insert a new record from gridview control Pin
sudhadotnet2-Apr-08 4:37
sudhadotnet2-Apr-08 4:37 
GeneralRe: to insert a new record from gridview control Pin
led mike2-Apr-08 6:50
led mike2-Apr-08 6:50 
Generaliframe src from code Pin
saud_a_k2-Apr-08 3:46
saud_a_k2-Apr-08 3:46 
GeneralRe: iframe src from code Pin
eyeseetee2-Apr-08 4:44
eyeseetee2-Apr-08 4:44 
GeneralRe: iframe src from code Pin
Krishnraj2-Apr-08 19:41
Krishnraj2-Apr-08 19:41 
QuestionHow to display data in content place holder dynamically Pin
psspl2-Apr-08 2:51
psspl2-Apr-08 2:51 
AnswerRe: How to display data in content place holder dynamically Pin
Matthew Ellis2-Apr-08 3:38
Matthew Ellis2-Apr-08 3:38 
AnswerRe: How to display data in content place holder dynamically Pin
eyeseetee2-Apr-08 3:46
eyeseetee2-Apr-08 3:46 
GeneralA potentially dangerous Request.Form value was detected from the client [modified] Pin
Bluebamboo2-Apr-08 1:57
Bluebamboo2-Apr-08 1:57 
GeneralRe: A potentially dangerous Request.Form value was detected from the client Pin
N a v a n e e t h2-Apr-08 3:20
N a v a n e e t h2-Apr-08 3:20 
GeneralRe: A potentially dangerous Request.Form value was detected from the client Pin
Bluebamboo2-Apr-08 4:29
Bluebamboo2-Apr-08 4:29 
GeneralRe: A potentially dangerous Request.Form value was detected from the client Pin
N a v a n e e t h2-Apr-08 4:34
N a v a n e e t h2-Apr-08 4:34 

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.