1 Replies - 1251 Views - Last Post: 20 December 2012 - 06:41 AM Rate Topic: ***** 1 Votes

#1 maheshkumar1228  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-December 12

to edit update the database through front end asp.net using c#

Posted 20 December 2012 - 03:27 AM

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();
  }
}



Is This A Good Question/Topic? 0
  • +

Replies To: to edit update the database through front end asp.net using c#

#2 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: to edit update the database through front end asp.net using c#

Posted 20 December 2012 - 06:41 AM

is there a question?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1