Hi all...
I have seven fields that need to be populated in seven text boxes. The data is coming from a SQL Compact DB...
Here's my code so far, but I'm stuck. What do I need to do to populate the text boxes on Form Load... thanks much.
Woody
private void mcContactSubmit_Load(object sender, EventArgs e)
{
// Setup our SQL connection.
SqlCeConnection dataSource = new SqlCeConnection(
@"Data Source=|DataDirectory|\..\..\ContactInformation.sdf;
Persist Security Info=False");
SqlCeDataReader myReader = null;
// Create our command text.
string sqlQuery = String.Format(@"SELECT TOP (1) FirstName, LastName, Title,
Department, Category, Phone, Comments FROM ContactInformation
ORDER BY FirstName DESC");
// Open the SQL connection.
dataSource.Open();
SqlCeCommand myCommand = new SqlCeCommand(sqlQuery, dataSource);
myReader = myCommand.ExecuteReader();
}