Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8628613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:35:27+00:00 2026-06-12T08:35:27+00:00

iam totally new to C#.net. I had problems while adding records to the connected

  • 0

iam totally new to C#.net. I had problems while adding records to the connected datasource which is an access file. The coding is:

    int MaxRows = 0;
    int inc = 0;

    private void Form2_Load(object sender, EventArgs e)
    {
        con = new System.Data.OleDb.OleDbConnection();
        ds1 = new DataSet();

        con.ConnectionString = " Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:/Documents and Settings/user/My Documents/anchu.accdb";
        string sql = "SELECT * From Table1";
        da = new System.Data.OleDb.OleDbDataAdapter(sql, con);

        con.Open();

        da.Fill(ds1, "Table1");
        NavigateRecords();

        con.Close();
        //con.Dispose();
    }
    private void NavigateRecords()
    {
        DataRow drow = ds1.Tables["Table1"].Rows[0];

        textBox1.Text = drow.ItemArray.GetValue(0).ToString();
        textBox2.Text = drow.ItemArray.GetValue(1).ToString();
        textBox3.Text = drow.ItemArray.GetValue(2).ToString();
        textBox4.Text = drow.ItemArray.GetValue(3).ToString();
    }


    private void groupBox1_Enter(object sender, EventArgs e)
    {

    }

    private void button2_Click(object sender, EventArgs e)
    {
        textBox1.Clear();
        textBox2.Clear();
        textBox3.Clear();
        textBox4.Clear();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        System.Data.OleDb.OleDbCommandBuilder cb;
        cb = new System.Data.OleDb.OleDbCommandBuilder(da);

        DataRow drow = ds1.Tables["Table1"].NewRow();
        drow[1] = textBox1.Text();
        drow[2] = textBox2.Text();
        drow[3] = textBox3.Text();
        drow[4] = textBox4.Text();

        ds1.Tables["Table1"].Rows.Add(drow);

        MaxRows = MaxRows + 1;
        inc = MaxRows - 1;

        da.Update(ds1, "Table1");

        MessageBox.Show("Entry Added");
    }
}

and i get 8 errors of the same type!

Non-invocable member ‘System.Windows.Forms.Control.Text’ cannot be used like a method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:35:28+00:00Added an answer on June 12, 2026 at 8:35 am

    Mistake example

    drow[1] = textBox1.Text();
    

    replace with

    drow[1] = textBox1.Text;
    

    A property doesn’t need brackets, and Text is a Property, not a method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am totally a new in asp.net but for some reason, i have to
I am new to ASP.NET. I am creating a website in which i have
I am totally new to HTML5. Previously I have developed Silverlight and ASP .Net
OK, I'm totally new to .NET MVC3 and I've run into a problem. I
I've recently started work on a new project using EpiServer which I am totally
I am totally new in appbiling service in android, and it seems to be
I am totally new to emacs and is starting to learn how to use
I am totally new to Sharepoint (2007) so please bear with me. I would
I am totally new to math/numerical analysis programming and I was looking all over
I am totally new to web services and cannot get mine to work. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.