TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rohit manhas
NA
25
0
convert JSP code to c#
Apr 24 2010 12:38 AM
i want to convert this code to c#..and if possible cud anyone explain me, what happens in the below code.....
............................................................................................................................................................................
ResultSet resultset;
try {
Connection connection = DriverManager.getConnection("jdbc:odbc:rmcwhDSN");
Statement statement = connection.createStatement();
resultset=statement.executeQuery("select * from LoginTable");
String user="";
String pass="";
String role="";
String prefix="";
String temprole="ADMIN";
int flag = 0;
if((request.getParameter("UserId") != null) && (request.getParameter("Password") != null))
{
user=request.getParameter("UserId");
pass=request.getParameter("Password");
}
while(resultset.next())
{
String UserId = resultset.getString("UserId");
String Password = resultset.getString("Password");
role=resultset.getString("Role");
out.println("role"+role);
prefix = resultset.getString("Prefix");
//if role is "ADMIN" then by defalt asign prefix as "XXX"
if(( UserId.equals(user) ) && (Password.equals(pass)) && (role.equals(temprole)))
{
flag = 2;
session.putValue("UserId", user);
session.putValue("Role",role);
session.putValue("Prefix", prefix);
}
else if(( UserId.equals(user) ) && (Password.equals(pass)))
{
flag = 1;
session.putValue("UserId", user);
session.putValue("Role",role);
//out.println("role"+role);
session.putValue("Prefix", prefix);
}
}
Reply
Answers (
4
)
Declaring an array of linked list in C#
problem selecting cell after datagridviewcell Drop Down