Hi every one
I'm trying to retrieve UserID (which is autonumber in ms access database) using C# and assign it to string u.I'm totally new to C# and trying to get more skills....
here goes..
string connStr, selectCmd;
connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=..\\library.accdb";
selectCmd = "SELECT * FROM users WHERE First_Name ='x' AND Last_Name = 'y'";
OleDbConnection conn;
OleDbDataAdapter myAdapter;
DataSet myDataSet = new DataSet();
conn = new OleDbConnection(connStr);
conn.Open();
myAdapter = new OleDbDataAdapter(selectCmd, conn);
myAdapter.Fill(myDataSet, "users");
u = myDataSet.Tables["users"].Columns[0].ToString();
All i'm getting at the end is name of the column in that table...but not the actual value
Thanks!