Hi,
please use this code like this pass your textbox ids.
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrin gs["WhateverYouWantToCallYourCon"].ToString());
try
{
SqlCommand command = new SqlCommand("select datef from table1 where id=1", connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.HasRows)
{
while (reader.Read())
{
//Assign to your label here
YourLable.Text = reader["datef"].ToString();
}
}
}
catch (SqlException ex)
{
Response.Write(ex.Message.ToString());
}
finally
{
connection.Close();
SqlConnection.ClearPool(connection);
}