Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Help in data selecting

Help in data selecting

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasesysadmindebugginghelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jacal99
    wrote on last edited by
    #1

    hi i can select all the data from access database using c# ... now i want to do is get the data from the database and display it in my textbox .... i am using repeater control to get data from database ... but unable to display it in my textbox field .... here is my all code with repeter control for selecting data. :) file name is db2.aspx <%@ Page Language="C#" Debug="True" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> void Page_Load(object sender, EventArgs e) { } void Button1_Click(object sender, EventArgs e) { OleDbConnection objConnection = null; OleDbCommand objCmd = null; string strConnection, strSQL; strConnection = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="+Server.MapPath(".\\database\\sample.mdb"); objConnection = new OleDbConnection(strConnection); objConnection.Open(); strSQL = "INSERT INTO emp (fname, lname) VALUES ( '"+TextBox1.Text+"' , '"+TextBox2.Text+"' )"; objCmd = new OleDbCommand(strSQL, objConnection); objCmd.ExecuteNonQuery(); objConnection.Close(); TextBox1.Text=""; TextBox2.Text=""; string oledbcon,oledbcom; oledbcon = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="+Server.MapPath(".\\database\\sample.mdb"); OleDbDataAdapter mycommand1 = new OleDbDataAdapter("Select fname,lname from emp",oledbcon); DataSet ds = new DataSet(); mycommand1.Fill (ds,"emp"); rept.DataSource = ds.Tables["emp"].DefaultView; rept.DataBind(); objConnection.Close(); }

    Access DataBase Is Inserting And View Data In Repeater.

    First Name:
    Last Name:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups