Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
I am trying to get results from a sql server query: using (SqlConnection myConnection = new SqlConnection(ConnStr)) { string oString = "Select Psw from Employees where Email = @E-Mail"; SqlCommand oCmd = new SqlCommand(oString, myConnection); oCmd.Parameters.AddWithValue("@E-Mail", Email.Text); myConnection.Open(); using (SqlDataReader oReader = oCmd.ExecuteReader()) { while (oReader.Read()) { } myConnection.Close(); } }the thing is, "Email" is PK, so I know I will get only one result - one column and one row - a single valueIs this possible to get this single value strait into a string, without using SqlDataReader? Because I know for sure I will get only one value so there is no need.Continue reading...
I am trying to get results from a sql server query:
using (SqlConnection myConnection = new SqlConnection(ConnStr))
{
string oString = "Select Psw from Employees where Email = @E-Mail";
SqlCommand oCmd = new SqlCommand(oString, myConnection);
oCmd.Parameters.AddWithValue("@E-Mail", Email.Text);
myConnection.Open();
using (SqlDataReader oReader = oCmd.ExecuteReader())
while (oReader.Read())
}
myConnection.Close();
the thing is, "Email" is PK, so I know I will get only one result - one column and one row - a single value
Is this possible to get this single value strait into a string, without using SqlDataReader? Because I know for sure I will get only one value so there is no need.
Continue reading...