using System; 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; using System.Drawing; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string s = System.Configuration.ConfigurationManager.ConnectionStrings["Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Documents and Settings\\Hitech\\Desktop\\JTS.mdb"].ConnectionString; SqlConnection con = new SqlConnection(s); SqlCommand cmd = new SqlCommand("select * from JTS where barcode='" + TextBox1.Text + "'", con); cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@Id", TextBox1.Text); cmd.Connection = con; con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { TextBox2.Text = dr["CNAME"].ToString(); TextBox3.Text = dr["MNAME"].ToString(); } dr.Close(); con.Close(); } }
1 Replies - 1797 Views - Last Post: 20 December 2012 - 06:41 AM
#1
to edit update the database through front end asp.net using c#
Posted 20 December 2012 - 03:27 AM
Replies To: to edit update the database through front end asp.net using c#
#2
Re: to edit update the database through front end asp.net using c#
Posted 20 December 2012 - 06:41 AM
is there a question?
Page 1 of 1