How to retrieve data from sqlserver
How to retrieve data from sqlserver . if i save 5000 in sqlserver then i have to add the value which i give in textbox in asp.net using c#.that 5000 should not be shown in running time.,
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted May 28, 2012, 12:02 AM
Can you please provide more information?
I didn't get question, what actually you want.
thx.
Keyur NarkhiPosted Apr 30, 2012, 4:17 AM
Below is the code for getting time.
protected void Page_Load(object sender, EventArgs e)
{
string connection1 = "connectionstring";
SqlConnection connection = new SqlConnection(connection1);
connection.Open();
SqlDataReader myReader = null;
SqlCommand myCommand = new SqlCommand("SELECT CONVERT(VARCHAR(8),GETDATE(),108) AS HourMinuteSecond", connection);
myCommand.Connection = connection;
myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
txt1.Text = myReader["HourMinuteSecond"].ToString();
}
}
Hope this helps
thanks