try
{
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["connString"].ConnectionString))
{
conn.Open();
using (SqlCommand cmd = new SqlCommand("Select * FROM [tbl_data] ORDER BY main", conn))
{
cmd.CommandType = CommandType.Text;
using (SqlDataReader reader = cmd.ExecuteReader())
{
if (reader.HasRows)
{
while (reader.Read())
{
NameAndCounty = reader["NameAndCounty"].ToString();
Id = reader["Id"].ToString();
ddlNameAndCounty.Items.Add(new ListItem(NameAndCounty, Id));
}
}
}
}
}
}
catch (Exception ex)
{
return ex.Message.Trim();
}
Software engineering and business solutions blog featuring SaaS reviews, automation tools, and business insurance guides. Buyer-intent content designed to drive high-quality traffic and conversions.
Subscribe to:
Post Comments (Atom)
How to Modernize Legacy .NET Applications
How to Modernize Legacy .NET Applications Understanding Legacy .NET Applications Definition and Characteristics Legacy .NET applicat...
-
How to clear SharePoint People Picker suggestion cache If you have been SharePoint Site owner long enough, you would have definitely ...
-
Getting the following error (Figure 1): Server Error in '/' Application. ID4014: A SecurityTokenHandler is not registered to ...
-
The problem was that the remote connection needed to utilize Named Pipes, but in order to utilize Named Pipes both the machine hosting the i...
No comments:
Post a Comment