J
jm
I manually put a datagrid in on a form. I then added this code to an
event to populate it:
OdbcConnection conn = new OdbcConnection("DSN=CardBase");
sqlCardHolders = "SELECT * FROM tblcardholders " +
"WHERE last_name LIKE '%" + txtLastName.Text + "%'";
DataSet rs = new DataSet();
conn.Open();
OdbcDataAdapter myOdbcAdapter = new
OdbcDataAdapter(sqlCardHolders, conn);
myOdbcAdapter.Fill(rs);
dgridSearchResults.DataSource = rs;
dgridSearchResults.SetDataBinding(rs,"CardHolders");
I do not see anything in the datagrid except a little box with a plus
and I can eventually expand it to show the row and it lets me edit it,
etc.
If I turn off Row Headers Visible, I don't even see the little plus.
I just want to query the database and have the rows show up. I don't
want to edit them or anything. I just can't find anything that shows
me some basic tutorial on this. Thank you for any help.
event to populate it:
OdbcConnection conn = new OdbcConnection("DSN=CardBase");
sqlCardHolders = "SELECT * FROM tblcardholders " +
"WHERE last_name LIKE '%" + txtLastName.Text + "%'";
DataSet rs = new DataSet();
conn.Open();
OdbcDataAdapter myOdbcAdapter = new
OdbcDataAdapter(sqlCardHolders, conn);
myOdbcAdapter.Fill(rs);
dgridSearchResults.DataSource = rs;
dgridSearchResults.SetDataBinding(rs,"CardHolders");
I do not see anything in the datagrid except a little box with a plus
and I can eventually expand it to show the row and it lets me edit it,
etc.
If I turn off Row Headers Visible, I don't even see the little plus.
I just want to query the database and have the rows show up. I don't
want to edit them or anything. I just can't find anything that shows
me some basic tutorial on this. Thank you for any help.