how to display values from database tables without using datagrid control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neena
    New Member
    • Aug 2006
    • 17

    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.
  • nmsreddi
    Contributor
    • Jul 2006
    • 366

    #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

    Comment

    • neena
      New Member
      • Aug 2006
      • 17

      #3
      Originally posted by nmsreddi
      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

      Comment

      • Mahesh_Bote
        New Member
        • Jul 2006
        • 26

        #4
        Originally posted by neena
        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

        Comment

        • neena
          New Member
          • Aug 2006
          • 17

          #5
          Originally posted by Mahesh_Bote
          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.EventArg s e)
          {
          MySqlConnection myConnection=ne w MySqlConnection (
          "server=localho st; userid=root; password=passwo rd;database=sal es;pooling=fals e;");

          String strSql;

          strSql="SELECT name,country,we bsite FROM accounts WHERE name= '" + TxtSearch.Text+ "' AND id='"+Label1.Te xt+ "'";

          MySqlCommand cmd=new MySqlCommand(st rSql,myConnecti on);

          MySqlDataAdapte r myAdapter=new MySqlDataAdapte r(strSql,myConn ection);
          DataSet sales=new DataSet();
          myConnection.Op en();
          myAdapter.Fill( sales,"accounts ");
          MySqlDataReader reader;

          foreach(DataRow dr in sales.Tables["accounts"].Rows)
          {
          reader=cmd.Exec uteReader();
          reader.Read();
          LBL_NAME1.Text= reader["name"].ToString();
          LBL_CNTRY1.Text =reader["country"].ToString();
          LBL_WEB1.Text=r eader["website"].ToString();


          LBL_NAME2.Text= reader["name"].ToString();
          LBL_CNTRY2.Text =reader["country"].ToString();
          LBL_WEB2.Text=r eader["website"].ToString();
          reader.Close();


          }

          }

          Comment

          Working...