B
Brian
Cheers for that.. seems to work but one problem!
I'm adding information on photos into a database. And this method is
to load categories into a ComboBox to choose how to categorise the
photo just added.
However, using the database in quotes like i do below.. it looks for
the database in the same folder as the location of the picture just
added.
I need it to load the database from the Debug folder of the project.
Any suggestions on how to implement this Debug folder into my
ConnectionString?
Thanks again for all the help!
Brian
--------------------------------------------
{
// load categories
string strSQL = "SELECT * FROM categories" ;
OleDbConnection conn = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=photoDB.mdb");
OleDbDataAdapter da = new OleDbDataAdapter(strSQL,conn);
DataSet ds = new DataSet();
da.Fill(ds);
cboCategory.DataSource = ds.Tables[0];
cboCategory.DisplayMember = "category"; //name of field you want to
display
}
I'm adding information on photos into a database. And this method is
to load categories into a ComboBox to choose how to categorise the
photo just added.
However, using the database in quotes like i do below.. it looks for
the database in the same folder as the location of the picture just
added.
I need it to load the database from the Debug folder of the project.
Any suggestions on how to implement this Debug folder into my
ConnectionString?
Thanks again for all the help!
Brian
--------------------------------------------
{
// load categories
string strSQL = "SELECT * FROM categories" ;
OleDbConnection conn = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=photoDB.mdb");
OleDbDataAdapter da = new OleDbDataAdapter(strSQL,conn);
DataSet ds = new DataSet();
da.Fill(ds);
cboCategory.DataSource = ds.Tables[0];
cboCategory.DisplayMember = "category"; //name of field you want to
display
}