i get an error when i try and do this.
private void button2_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
DBconnect db = new DBconnect();
Global.GlobalVar = textBox1.Text;
string Co = new Password('J', textBox1.Text).SetSql();
ds = db.GetDataSet(Co);
DataTable dt = ds.Tables[0];
if (dt.Rows.Count == 0)
{
if (textBox1.Text != "")
{
MessageBox.Show("Password Does Not Exist");
textBox1.Text = "";
}
else
{
this.Close();
}
}
else
{
Co = new Password('K', "").SetSql();
ds = db.GetDataSet(Co);
DataRow dr = dt.Rows[0];
DataColumn dc = dt.Columns[0];
foreach (DataRow row in dt.Rows)
{
foreach (DataColumn column in dr.Table.Columns)
{
Global.GlobalVar2 = [B]dc[/B][1].ToString();
Global.GlobalVar3 = [B]dc[/B][1].ToString();
}
}
this.Close();
}
}
Where it says "Global.GlobalVar 2-3" the error states.
"System.Data.DataColumn.this[int] is inaccessible due to it's protection level"
I'm not sure what to do about it.