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
anil wagavkar
NA
13
5.5k
How to write two select query in one button click event
Mar 25 2016 1:38 AM
my code is i wana write another select statment in this button but i am confuse where....plz help
protected void Button4_Click(object sender, EventArgs e)
{
if (rankuserid.Text.Length == 0)
{
Response.Write("<script>alert('Please type RankUser ID correctly and click Submit button again. Thanks....')</script>");
}
else
{
con.Open();
SqlCommand cmd = new SqlCommand("select * from salesmans_master where rankuser=" + rankuserid.Text);
cmd.Connection = con;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
rankcode.Text = dr["rankcode"].ToString();
be.Text = dr["rank1"].ToString();
srbe.Text = dr["rank2"].ToString();
fdo.Text = dr["rank3"].ToString();
fi.Text = dr["rank4"].ToString();
srfi.Text = dr["rank5"].ToString();
doff.Text = dr["rank6"].ToString();
zo.Text = dr["rank7"].ToString();
po.Text = dr["rank8"].ToString();
pog.Text = dr["rank9"].ToString();
bd.Text = dr["rank10"].ToString();
con.Close();
}
}
Reply
Answers (
4
)
Sql instruction doesnt obey...
Convert the Datatable column value into column