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
mohdazeemuddin ahmed
NA
176
0
how to hold data from the database
Apr 20 2009 6:34 AM
Hi
i write the code for reading the data from the database its is working fine. the code for reading data is
public void getuid()
{
string str1;
SqlConnection con = new SqlConnection("server=.;database=Ckom;uid=sa");
SqlCommand cmd = new SqlCommand("select max(UserID) uid from UserDetail",con);
SqlDataReader ddDr;
con.Open();
ddDr=cmd.ExecuteReader();
while (ddDr.Read())
{
str1 = ddDr["uid"].ToString();
Response.Write(str1]);
}
}
if i write Response.write(str1) method inside the while loop its working fine
but if i used same Response.write(str1) its showing me error that
Use of unassigned local variable 'str1'
please help me i need the value
because with that value i need to read data from other table
please help me
Reply
Answers (
3
)
Roll Based Security
Differences between method overloading and Generics