joecoolish
Programmer
k, so I want have a db that creates a record of who enters the site and at what time. I also want to do a check to see if they have ever been there before. The site is hosted on the local intranet, and it takes the users NT Login.
the obj that i get the NTID from is
IIdentity wi = WindowsIdentity.GetCurrent();
and I get it to a string with the
wi.Name.ToString();
I connect, and query the database with this:
this.Open(); //member function that opens the db conn
string dbtemp="", query1 = "SELECT "+column+" FROM "+table+" WHERE "+column+"=\'"+search+"\'";
[string column = "ntid", table = "userInfo", search = wi.Name.ToString();] // normally these are parameters inputed into the function, that's why there is []
SqlCommand cmd = new SqlCommand(query1, mySqlConn);
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
da.SelectCommand = cmd;
da.Fill(ds);
k, so I've just queried to see if their NTID is in the db already, and I have a DataSet with the info, so my question is, how do I compare the 2 (the info in the DS and the wi.Name.ToString()
? And how do i get the value of a single row with a DataSet? Is there an easier way?
Thanks!
Joel
the obj that i get the NTID from is
IIdentity wi = WindowsIdentity.GetCurrent();
and I get it to a string with the
wi.Name.ToString();
I connect, and query the database with this:
this.Open(); //member function that opens the db conn
string dbtemp="", query1 = "SELECT "+column+" FROM "+table+" WHERE "+column+"=\'"+search+"\'";
[string column = "ntid", table = "userInfo", search = wi.Name.ToString();] // normally these are parameters inputed into the function, that's why there is []
SqlCommand cmd = new SqlCommand(query1, mySqlConn);
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
da.SelectCommand = cmd;
da.Fill(ds);
k, so I've just queried to see if their NTID is in the db already, and I have a DataSet with the info, so my question is, how do I compare the 2 (the info in the DS and the wi.Name.ToString()
Thanks!
Joel