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)
Loading
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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Apr 7, 2013, 2:28 PM
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 babaPosted Apr 7, 2013, 3:19 PM