If u don't wants to use grid, the u have to use Table. u have to assign each column value to each cell with the help of loop.
Mahesh
Hi
thanks for the reply.But i am still in doubt :confused:
I want to display the search results in table as rows (like the gmail or yahoo mailbox).I attached my code here.Can i use any array?but i dont know how to apply it here. otherwise for each table row i have to write the code.& it becomes very bulky rt?
So is there any other way?plz help me by giving ur suggestions.
private void Go_Button_Click(object sender, System.EventArgs e)
{
MySqlConnection myConnection=new MySqlConnection(
"server=localhost; userid=root; password=password;database=sales;pooling=false;");
String strSql;
strSql="SELECT name,country,website FROM accounts WHERE name= '" + TxtSearch.Text+ "' AND id='"+Label1.Text+ "'";
MySqlCommand cmd=new MySqlCommand(strSql,myConnection);
MySqlDataAdapter myAdapter=new MySqlDataAdapter(strSql,myConnection);
DataSet sales=new DataSet();
myConnection.Open();
myAdapter.Fill(sales,"accounts");
MySqlDataReader reader;
foreach(DataRow dr in sales.Tables["accounts"].Rows)
{
reader=cmd.ExecuteReader();
reader.Read();
LBL_NAME1.Text=reader["name"].ToString();
LBL_CNTRY1.Text=reader["country"].ToString();
LBL_WEB1.Text=reader["website"].ToString();
LBL_NAME2.Text=reader["name"].ToString();
LBL_CNTRY2.Text=reader["country"].ToString();
LBL_WEB2.Text=reader["website"].ToString();
reader.Close();
}
}