I'm totally new to this, as will be evident, and I can't figure out the syntax for what should be the most basic code.
I'm just trying to get a piece of data from a SQL database and store it in a variable. From various book and websites, I cobbled together the mess below. What I'm attempting (using LINQ to SQL) is to get a value from the "Password" field of a database, and compare it to a string entered into a text box web control:
string LoginName = Login_TextBox.Text;
string PasswordString = Password_Textbox.Text;
using (Link2StoryListDataContext db = new Link2StoryListDataContext())
{
var theP =
from p in db.Admins
where p.Login is LoginName
select p.Password;
var thePW = db.ExecuteQuery(theP);
}
I also tried variations of this instead:
var theResults = db.ExecuteQuery("select db.Password where db.Login = LoginName");
Can some kind soul point me in the right direction?