manually populate from sqldatasource
Dear friends,
I am trying following code, but it is not working could you please guide me (the connection string is successfully retrieved), I want to bind data to grid and well as form view
SqlDataSource sqlds = new SqlDataSource();
sqlds.ConnectionString = (ConfigurationManager.ConnectionStrings["bdirectConnectionString"]).ToString();
sqlds.SelectCommandType = SqlDataSourceCommandType.Text;
string country = Request.QueryString["country"];
if (country != "")
{
sqlds.SelectCommand = "select messers,btype,category,subcategory,contactpers,tel mob,fax,email,websites,address,locality,city,state ,country,pincode,adwordings from venddata where country like '%" + country + "%'";
}
sqlds.Select(DataSourceSelectArguments.Empty);
GridView1.DataSource = sqlds;
|