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
nitish rai
NA
319
18.8k
how to data bind from store procedure and data display in
Dec 15 2017 7:10 AM
how to data bind from store procedure and data display in tex box
Please help me.
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
MyLabel.Text = DateTime.Now.ToString("00:01:10 tt");
MyLabel.Visible = false;
}
string connect = ConfigurationManager.ConnectionStrings["demoConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["demoConnectionString"].ConnectionString);
con.Open();
SqlDataReader myReader = null;
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetProcreatePossimate";
DataTable dt = new DataTable();
myReader = cmd.ExecuteReader();
while (myReader.Read())
{
TextBox1.Text = (myReader["Active Power KW"].ToString());
TextBox2.Text = (myReader["Power Factor"].ToString());
TextBox3.Text = (myReader["Current Amp"].ToString());
TextBox4.Text = (myReader["Voltage V"].ToString());
TextBox5.Text = (myReader["Frequency Hz"].ToString());
}
con.Close();
}
code is not work.
Reply
Answers (
2
)
How to Run exe file by default ?
sessions in dotnet