a field from the table that is "like" the string being inputted.
However, the dataset comes back empty...well not empty, I get a column name but no data. So when I type in
Expand|Select|Wrap|Line Numbers
- ds.Tables[0].Columns[0].ColumnName
When I run the query inside Access I receive the desired information. But when I try to check for the info in code
Expand|Select|Wrap|Line Numbers
- ds.Rows[0]
Expand|Select|Wrap|Line Numbers
- public DataTable FindFullPNusingPartialPN(string _parcelNumber)
- {
- OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + ConfigurationManager.AppSettings["TaxCert_Database"]); DataTable dt = new DataTable();
- try
- {
- string query = "SELECT ParcelNumber FROM Orders WHERE ParcelNumber LIKE '*" + _parcelNumber + "*';";
- OleDbDataAdapter adapter = new OleDbDataAdapter(query, conn);
- DataSet ds = new DataSet();
- adapter.Fill(ds);
- if (ds.Tables[0].Rows.Count >= 0)
- {
- dt = ds.Tables[0];
- }
- }
- catch (Exception ex)
- {
- throw;
- }
- finally
- {
- if (conn.State == ConnectionState.Open)
- {
- conn.Close();
- }
- }
- return dt;
- }