selvi subramanian

selvi subramanian

  • NA
  • 799
  • 572.6k

I need retrieve time from sqlserver to asp.net using c# in a textbox

Apr 11 2012 2:24 AM
i need retrieve time from sqlserver to asp.net using c# in a textbox.........





    protected void Page_Load(object sender, EventArgs e)
    {
        SqlDataReader sdr = null;
        string qry = "select logintime from logintime";
        ds = net.GETDS(qry);
        da.Fill(ds, "logintime");
       // TextBox1.Text = ds.Tables["logintime"].Rows[indes]["logintime"].ToString();
        while (sdr.Read())
        {
            TextBox1.Text = sdr["logintime"].ToString();
        }
    }
}


it throws the error like this         (  The SelectCommand property has not been initialized before calling 'Fill'.)












Answers (6)