I created a dataset (DataSet1.xsd). I then created a TableAdapter (DataTable1TableAdapter) and added a query (images below):
When I preview the data, I see exactly what I was expecting: lots of returned rows.
In my C# program, in the button1_Click event, I tried to type the following:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MailingList
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.DataTable1TableAdapter.Fill(this.DataSet1.DataTable1);
foreach (DataRow row in DataTable1.Rows)
{
// insert code here to work with the data
}
}
}
}
The problem is that IntelliSense doesn't recognize my datatable and places a squiggly red line under it. Since I described|desgined the datatable in the designer screen, shouldn't it be available to me to use in my program? Or, do I have to define the datatable and add the columns to it within the program?
Thanks for any help!