I'm trying to Bind 3 textboxes to a Class that retrieves any previously stored records for each of the 3 textboxes. I don't know how to retrieve 3 different values from a class in a Object Orientated perspective. I know how to return single strings, bool, etc vars but not more than 1 at a time.
example of a simple bool returning method I use, how do I adjust it to return 3 separate string variables - Code Snippet:
public static Boolean isQuestionnaireComplete(string strHash)
{
SqlConnection con = Sql.getConnection();
try
{
SqlCommand cmd = new SqlCommand("SELECT IsComplete FROM UserDetails WHERE Hash='" + strHash + "' AND IsComplete=1");
cmd.Connection = con;
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
con.Open();
da.Fill(dt);
if (dt.Rows.Count == 0)
{
return false;
}
else
{
return true;
}
}
catch
{
//TODO:log error
return false;
}
finally
{
con.Close();
}
}
ASPX Snippet:
<asp:TextBox runat="server" ID="txt1" Height="200px" Width="600px"></asp:TextBox>
<asp:TextBox runat="server" ID="txt2" Height="200px" Width="600px"></asp:TextBox>
<asp:TextBox runat="server" ID="txt3" Height="200px" Width="600px"></asp:TextBox>