467,087 Members | 1,261 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,087 developers. It's quick & easy.

how to display values from database tables without using datagrid control

how to display values from database tables without using datagrid control in C# .net.I want to search the values from database & the search results to be shown as rows in the web form,without the use of datagrid.So any one plz help me.
Aug 22 '06 #1
  • viewed: 6688
Share:
4 Replies
256MB
hi

can u post your query more specific


you just want to avoid datagrid or you dont want to go for any other control like label...or u want to print directly on the web form what actually is your problem



bye
Aug 23 '06 #2
hi

can u post your query more specific


you just want to avoid datagrid or you dont want to go for any other control like label...or u want to print directly on the web form what actually is your problem



bye
Hi
I want to knw,

how to retrieve multiple records from SQL tables using MYSQL data connecter/net and display in html tables without using any data grid. Idon't know how to use the EOF file feature of data set to retrieve the records

Plz help me
Aug 23 '06 #3
Hi
I want to knw,

how to retrieve multiple records from SQL tables using MYSQL data connecter/net and display in html tables without using any data grid. Idon't know how to use the EOF file feature of data set to retrieve the records

Plz help me

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
Aug 23 '06 #4
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();


}

}
Aug 28 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Craig Banks | last post: by
3 posts views Thread by .Net Newbie | last post: by
2 posts views Thread by news@visual-basic-data-mining.net | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.