Code
Design table with following attribute ltem_ld ,ltem__Name ,Item_Rate ,_ltem_Qty and update
ltem_Rate and ltem_Qty using Ado.Net(Sql Server) Design table with following attribute ltem_ld ,ltem__Name ,Item_Rate ,_ltem_Qty and update
ltem_Rate and ltem_Qty using Ado.Net(Sql Server)Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Apr 7, 2013, 10:28 AM EDT
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace Gridview
{
public partial class WebForm4 : System.Web.UI.Page
{
string connStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlCommand com;
string str;
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(connStr);
con.Open();
str = "update item set Item_Rate='" + TextBox3.Text + "',ltem_Qty='" + TextBox4.Text + "'where ltem_ld='" + TextBox1.Text + "' and ltem_Name='" + TextBox2.Text + "'";
com = new SqlCommand(str, con);
com.ExecuteNonQuery();
con.Close();
Response.Write("Updated");
}
}
}
xenoix baba40 reputationPosted Apr 7, 2013, 11:19 AM EDT