الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مسااعدة لو سمحتم

بدأه ihbweb في 4 يناير 2009 · 2 رد · 436 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

update لو سمحتم يا اخواني انا عايز اعرف ليه الكود ده مش بيعمل

protected void Page_Load(object sender, EventArgs e)

{

string ConnStr = "server=localhost;initial catalog=northwind;trusted_connection=true";

SqlConnection con = new SqlConnection(ConnStr);

string query = "Select LastName from Employees where EmployeeID=1";

SqlDataAdapter da = new SqlDataAdapter(query, con);

DataSet ds = new DataSet();

da.Fill(ds);

foreach(DataRow dr in ds.Tables[0].Rows)

{

TextBox1.Text = dr["LastName"].ToString();

}

protected void Button1_Click(object sender, EventArgs e)

{

string ConnStr = "server=localhost;initial catalog=northwind;trusted_connection=true";

SqlConnection con = new SqlConnection(ConnStr);

string query = "Update Employees set LastName='"+TextBox1.Text+"' where EmployeeID=1";

SqlCommand cmd = new SqlCommand(query, con);

con.Open();

cmd.ExecuteNonQuery();

con.Close();

وجزاكم الله خير ا

#2

protected void Page_Load(object sender, EventArgs e)

{

string ConnStr = "server=localhost;initial catalog=northwind;trusted_connection=true";

SqlConnection con = new SqlConnection(ConnStr);

string query = "Select LastName from Employees where EmployeeID=1";

SqlDataAdapter da = new SqlDataAdapter(query, con);

DataSet ds = new DataSet();

da.Fill(ds);

foreach(DataRow dr in ds.Tables[0].Rows)

{

TextBox1.Text = dr["LastName"].ToString();

}

protected void Button1_Click(object sender, EventArgs e)

{

string ConnStr = "server=localhost;initial catalog=northwind;trusted_connection=true";

SqlConnection con = new SqlConnection(ConnStr);

string query = "Update Employees set LastName='"+TextBox1.Text+"' where EmployeeID=1";

SqlCommand cmd = new SqlCommand(query, con);

con.Open();

cmd.ExecuteNonQuery();

con.Close();

وجزاكم الله خير ا

#3

طيب .. اكتب رسالة الخطأ .. لأجل اختصار الوقت

اللهم أطل عمري وأحسن عملي واختم بالشهادة أجلي

مواضيع مشابهة