By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,561 Members | 3,127 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,561 IT Pros & Developers. It's quick & easy.

how to display values from database tables without using datagrid control

P: 17
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
Share this Question
Share on Google+
4 Replies


100+
P: 366
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

P: 17
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

P: 26
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

P: 17
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.