try { SqlDataAdapter da = new SqlDataAdapter("select * from login", con); DataSet ds = new DataSet(); con.Open(); da.Fill(ds, "login"); con.Close(); if (ds.Tables[0].Rows.Count > 0) { TableRow r = new TableRow(); r.BackColor = System.Drawing.Color.Blue; r.ForeColor = System.Drawing.Color.White; Table1.GridLines = GridLines.Both; TableCell c = new TableCell(); Label l = new Label(); l.Text = "User Name"; c.Controls.Add(l); r.Controls.Add(c); Table1.Controls.Add(r); TableCell c1 = new TableCell(); TextBox t = new TextBox(); t.Text = ds.Tables[0].Rows[0]["UName"].ToString(); c1.Controls.Add(t); r.Controls.Add(c1); Table1.Controls.Add(r); TableRow r1 = new TableRow(); r1.BackColor = System.Drawing.Color.Blue; r1.ForeColor = System.Drawing.Color.White; Table1.GridLines = GridLines.Both; TableCell c2 = new TableCell(); Label l1 = new Label(); l1.Text = "Password"; c2.Controls.Add(l1); r1.Controls.Add(c2); Table1.Controls.Add(r1); TableCell c3 = new TableCell(); TextBox t2 = new TextBox(); t2.TextMode = TextBoxMode.Password; t2.Text = ds.Tables[0].Rows[0]["Password"].ToString(); c3.Controls.Add(t2); r1.Controls.Add(c3); Table1.Controls.Add(r1); } else { } } catch (Exception Main) { lblMsg.Text = Main.Message.ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)