And a function (above) that will add the data to the table when called. So when a user clicks a button this code runs.
C#
privatevoidsaveToolStripMenuItem_Click(object sender, EventArgs e) ///Save Sheet Menu Item///
{
{
if (check_data() == (true))
{
if (MessageBox.Show("Do you want to save?", "Notepad", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
save_sheet(ref dtPad);
}
}
else
{
}
}
However im having a hard time calling the save_sheet function while im passing the table to the function. Im getting this error:
SQL
Error 1 The name 'dtPad' does not exist in the current context
Error 2 The best overloaded methodmatchfor'Simple_Notepad.Form1.save_sheet(ref System.Data.DataTable)' has some invalid arguments
Error 3 Argument '1': cannot convertfrom'ref dtPad'to'ref System.Data.DataTable'
Any light you can shed on this topic would be wonderful because after 2 hours of Googleing i just don't know how to fix this.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Devin21 reputationPosted Jun 19, 2009, 3:17 PM EDT
-Devin
ishika3 reputationPosted Jun 26, 2009, 3:08 AM EDT