Click here to Skip to main content
15,919,893 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionincrease the size of content page. Pin
maheshsahini24-Mar-09 21:30
maheshsahini24-Mar-09 21:30 
AnswerRe: increase the size of content page. Pin
Abhijit Jana24-Mar-09 22:05
professionalAbhijit Jana24-Mar-09 22:05 
Questionconnection code problem.. Pin
yorockk24-Mar-09 21:29
yorockk24-Mar-09 21:29 
AnswerRe: connection code problem.. Pin
Abhijit Jana24-Mar-09 21:58
professionalAbhijit Jana24-Mar-09 21:58 
GeneralRe: connection code problem.. Pin
yorockk24-Mar-09 22:51
yorockk24-Mar-09 22:51 
GeneralRe: connection code problem.. Pin
Abhijit Jana24-Mar-09 23:12
professionalAbhijit Jana24-Mar-09 23:12 
GeneralRe: connection code problem.. Pin
yorockk25-Mar-09 3:45
yorockk25-Mar-09 3:45 
AnswerRe: connection code problem.. Pin
Greg Chelstowski25-Mar-09 1:28
Greg Chelstowski25-Mar-09 1:28 
I do not get why people have not caught that sooner, but your SQLString will never take txtname's text into consideration, just the actual string 'txtname.text'.
I'm not at all proficient with vb, but i'm pretty sure, if you wanted to pass user input data as part of your where clause you would have to do:
cmd.CommandText = "select * from employee where emp_name='"+txtname.text+"'"


I do suggest you use parameterized queries or stored procedures instead to avoid sql injection.
Otherwise, if somebody puts "0--;delete from employee" or something of that sort, you're screwed.

To use parameters in your queries, set the command first and then add the parameters, like so:
cmd.CommandText = "select * from employee where emp_name=@empname";
cmd.Parameters.Add("@empname", SqlDbType.NVarChar,50).Value = txtname.text;


I still do advise using stored procedures.

Regards,
Greg

var question = (_2b || !(_2b));

GeneralRe: connection code problem.. Pin
yorockk25-Mar-09 3:43
yorockk25-Mar-09 3:43 
GeneralRe: connection code problem.. Pin
yorockk25-Mar-09 3:48
yorockk25-Mar-09 3:48 
Questionpaging in datalist Pin
maheshsahini24-Mar-09 21:27
maheshsahini24-Mar-09 21:27 
AnswerRe: paging in datalist Pin
Abhijit Jana24-Mar-09 22:02
professionalAbhijit Jana24-Mar-09 22:02 
AnswerRe: paging in datalist Pin
vinodkrebc24-Mar-09 23:42
vinodkrebc24-Mar-09 23:42 
Questionpostback in asp.net Pin
viit.projectgroup24-Mar-09 21:08
viit.projectgroup24-Mar-09 21:08 
AnswerRe: postback in asp.net Pin
Abhijit Jana24-Mar-09 21:59
professionalAbhijit Jana24-Mar-09 21:59 
AnswerRe: postback in asp.net Pin
kumar_k50824-Mar-09 23:20
kumar_k50824-Mar-09 23:20 
Questionwant to Display Upper Case Letters in Text Box while Pressing Lower Case Letters ? Pin
pramod251724-Mar-09 20:44
pramod251724-Mar-09 20:44 
AnswerRe: want to Display Upper Case Letters in Text Box while Pressing Lower Case Letters ? Pin
Abhijit Jana24-Mar-09 22:06
professionalAbhijit Jana24-Mar-09 22:06 
GeneralRe: want to Display Upper Case Letters in Text Box while Pressing Lower Case Letters ? Pin
pramod251724-Mar-09 23:12
pramod251724-Mar-09 23:12 
GeneralRe: want to Display Upper Case Letters in Text Box while Pressing Lower Case Letters ? Pin
Abhijit Jana24-Mar-09 23:19
professionalAbhijit Jana24-Mar-09 23:19 
AnswerRe: want to Display Upper Case Letters in Text Box while Pressing Lower Case Letters ? Pin
SunithaNallana24-Mar-09 23:00
SunithaNallana24-Mar-09 23:00 
GeneralRe: want to Display Upper Case Letters in Text Box while Pressing Lower Case Letters ? Pin
pramod251724-Mar-09 23:15
pramod251724-Mar-09 23:15 
AnswerRe: want to Display Upper Case Letters in Text Box while Pressing Lower Case Letters ? Pin
vinodkrebc24-Mar-09 23:50
vinodkrebc24-Mar-09 23:50 
Questionhow to refresh only adrotator and not the web page Pin
aashish.saalvi24-Mar-09 20:00
aashish.saalvi24-Mar-09 20:00 
AnswerRe: how to refresh only adrotator and not the web page Pin
Christian Graus24-Mar-09 20:17
protectorChristian Graus24-Mar-09 20:17 

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.