Results 1 to 3 of 3

Thread: Need help in retrieving and posting data to the database (ms access) from C#.net

  1. #1
    Join Date
    Feb 2012
    Posts
    125

    Need help in retrieving and posting data to the database (ms access) from C#.net

    I have just now completed C#.net and I have created form as well as the database connection using ms acess but then I donít have much knowledge in retrieving and posting data to the database, is there anyone who has an idea about the same and can help me out with it??? Any help regarding this will be highly appreciated.

  2. #2
    Join Date
    Mar 2010
    Posts
    145

    Re: Need help in retrieving and posting data to the database (ms access) from C#.net

    I have just now completed C#.net and I have created form as well as the database connection using ms acess but then I don’t have much knowledge in retrieving and posting data to the database, is there anyone who has an idea about the same and can help me out with it??? Any help regarding this will be highly appreciated.
    You have not mentioned the scenario in your case, I mean the table name and the code that you might be trying out, if you need help from the start then you can just check out the below guide and see if it is helping:
    How to retrieve and display records from an Access database by using ASP.NET,ADO.NET, and Visual C# .NET

  3. #3
    Join Date
    May 2009
    Posts
    542

    Re: Need help in retrieving and posting data to the database (ms access) from C#.net

    If you want then you can try out the below code, here the name of the table is customer information, when you will enter the customer name in one text then you will get the other information of the customer in other text boxes, if you have much idea about the card then you wonít have issues in understanding the below code:
    con.Open();
    str = "Select * from customerinfo where(cname='" + textBox1.Text + "')";

    cmd = new SqlCommand(str, con);
    dr = cmd.ExecuteReader();
    if(dr.HasRows)
    {
    while (dr.Read())
    {
    textBox2.Text = dr["customerid"].ToString();
    textBox3.Text = dr["address"].ToString();
    textBox4.Text = dr["contactno"].ToString();
    textBox5.Text = dr["email"].ToString();
    }
    con.close();
    dr.close();
    }

Similar Threads

  1. Replies: 5
    Last Post: 04-08-2010, 09:47 AM
  2. Inserting and retrieving images from Database
    By Ainsley in forum Software Development
    Replies: 3
    Last Post: 25-01-2010, 12:49 PM
  3. Retrieving data from an XML file for use in a servlet
    By VinFanatic in forum Software Development
    Replies: 3
    Last Post: 12-05-2009, 06:03 PM
  4. How to retrieving data in a file from Creating form
    By MARCIA in forum Software Development
    Replies: 3
    Last Post: 10-03-2009, 11:18 AM
  5. Retrieving data from damaged HDD
    By Adit in forum Hardware Peripherals
    Replies: 2
    Last Post: 22-11-2008, 04:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •