Search code examples
c#visual-studioms-accesstableadapter

Passing a string to TableAdapter


I am just trying to store a string variable into the MSAccess DB by passing it to the fill method of an adapter. It looks like I am doing something wrong as the method only seems to accept datatable parameters. Here is the code I am using

private void button4_Click(object sender, EventArgs e)
    {
        FolderBrowserDialog fbd = new FolderBrowserDialog();
        DialogResult result = fbd.ShowDialog();
        string files = fbd.SelectedPath;
        Database_MyDataSetTableAdapters.SettingsTableAdapter adapter = new Database_MyDataSetTableAdapters.SettingsTableAdapter();
        adapter.Fill(files.ToString());                   
    }

Any help will be appreciated


Solution

  • I've found the answer: I was simply using the wrong method. I was using Fill instead of Update to send Data to the DB.