This is what I have in place:
1) The forename and surname of the Windows logged on user in a string.
var uname = "<%=Replace(Request.ServerVariables("LOGON_USER"),"Domain\","")%>";
var arr = uname.split(" ");
var fname = (arr);
var sname = (arr);
This works fine.
This is what I need (if any of it is possible!) :
I also need to know how to connect to the database before executing the statement.
2) I then need to check a particular column in that record, but I have two issues with this:
a) I need to have an INSERT INTO query when a page loads (aspx page) and currently have:
<asp:SqlDataSource runat="server" id="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:Phone extensionsViewer %>" ProviderName="<%$ ConnectionStrings:Phone extensionsViewer.ProviderName %>" InsertCommand="INSERT INTO Phone Extensions$ ('column name') VALUES ('True')"></asp:SqlDataSource>
- This doesn't work!! (But I think I can look into this myself)
b) The other issue I have is in regards to number 1 above. I would like, after selecting the record for the user, to check that the column I insert into as in step a, contains the value "true". So something like: SELECT column name FROM users WHERE Firstname = fname AND Surname = sname > from this, check that "column name" = 'true'.
I apologise if I have made this sound really complicated... it does need breaking down in explanation more so please ask me to be clearer if needed, but I would appreciate solutions to any part of the above if not all.
Also, I am using aspx pages.
Thank you in advance.