I am using Postgresql in VS 2013 and C#.
I use this for the reading of just one row by primary key.
string p has the users id it must look for in the table.
I now want the first column of the row to be moved to another string like:
But all I get is literally the field's name, 'user_id' in got_userID when I display it via messageBox.Show !
Any idea why?
Thanks!
I use this for the reading of just one row by primary key.
string p has the users id it must look for in the table.
Code:
cn.Open(); selectSql = "SELECT user_id,user_name,user_password,user_administrator FROM userlogon WHERE user_id ='" + p + "'"; cmd.CommandText = selectSql; NpgsqlDataAdapter da = new NpgsqlDataAdapter(selectSql, conn); NpgsqlCommandBuilder cdb = new NpgsqlCommandBuilder(da); DataSet ds = new DataSet(); DataTable dt = new DataTable(); ds.Reset(); da.Fill(ds); dt = ds.Tables[0];
Code:
got_userID = dt.Columns[0].ToString();
Any idea why?
Thanks!