Answer to Question #31931 in C# for Tima
2013-06-11T04:58:03-04:00
public partial class Edit : System.Web.UI.Page
{
SqlConnection sqlcon = new SqlConnection(@"Server=USER-PC;database=Asset_Store;uid=sa;pwd=sa;");
SqlCommand sqlcmd;
SqlDataAdapter da;
DataTable dt = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
sqlcon.Open();
sqlcmd = new SqlCommand("select * from category" , sqlcon);
da = new SqlDataAdapter(sqlcmd);
da.Fill(dt);
if (dt.Rows.Count > 0)
{
TextBox4.Text = dt.Rows[0][7].ToString();
TextBox2.Text = dt.Rows[0][8].ToString();
TextBox3.Text = dt.Rows[0][9].ToString();
}
sqlcon.Close();
}
}
this program is only reading the first row
when i press edit in any other row the data of the first row appear
wat to do?
0
Answer in progress...
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS !
Learn more about our help with Assignments:
C#
Comments
Leave a comment