David

David

  • NA
  • 2
  • 0

Not sure where to post this. (Query string result)

Aug 17 2006 1:28 PM
Hi,
Im writing an ASP.Net web form with C# code behinds. (.net 2.0 / MSVisualStudio 2005 Pro)
I have a sql string ....

string strSQL = "SELECT Email FROM form WHERE Email = ('" + EmailAddressTxtBox.Text + "')";

Which Im trying to compare the result of to see if the email exists in my DB.

OdbcCommand myODBCCommand = new OdbcCommand(strSQL, conn);

conn.Open();

myODBCCommand.ExecuteNonQuery();

string EmailResult =  ???????????????  ;

if (EmailResult == " ")

EmailNullLbl.Text = "Email address does not exist.";

else

EmailNullLbl.Text = " ";

Basically, if there is a result from the query , that means the email exists in the DB and if there is no result in the query, the email does not exist in the DB. If it doesn't exist in the DB then I want my label (EmailNullLbl.Text) to say the email does not exist.

My question is the section with the question marks in red above. I know the query works because if the email does exist , it displays the whole row on my page via a details view data control. But what would the result of my query be stored under? What is it called?

Please and thanks..for any help.
Regards,
David


Answers (1)