Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Display data using HyperLink

Display data using HyperLink

Scheduled Pinned Locked Moved C#
databasetutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shaina2231
    wrote on last edited by
    #1

    From database i m fetching data i want to display Data in hyperlink (Windows form application) the code is below

    string conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + "\\db1.mdb";

            OleDbConnection con = new OleDbConnection(conn);
    
            OleDbCommand cmd = con.CreateCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "Select \* from Player where CountryID=" + index;
            OleDbDataAdapter da = new OleDbDataAdapter(cmd);
            DataSet ds = new DataSet("Player");
            OleDbCommandBuilder oldbcbr = new OleDbCommandBuilder(da);
            da.Fill(ds, "Player");
           
            
            dataGridView2.DataSource = ds;
            DataTable dt = new DataTable();
            da.Fill(dt);
    
            dataGridView2.DataSource = dt;
            try
            {
    
    
                for (int i = 0; i <= ds.Tables\[0\].Rows.Count - 1; i++)
                {
                    MessageBox.Show(ds.Tables\[0\].Rows\[i\].ItemArray\[0\] + " -- " + ds.Tables\[0\].Rows\[i\].ItemArray\[1\]);
    
                   
                    
                    
                    
                }
    
    
            }
            catch (Exception ex)
            {
                MessageBox.Show("Can not open connection ! ");
            }
    

    Pls tell me how to display data as hyperlink in gridview or using Some other Control

    A 1 Reply Last reply
    0
    • S shaina2231

      From database i m fetching data i want to display Data in hyperlink (Windows form application) the code is below

      string conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + "\\db1.mdb";

              OleDbConnection con = new OleDbConnection(conn);
      
              OleDbCommand cmd = con.CreateCommand();
              cmd.CommandType = CommandType.Text;
              cmd.CommandText = "Select \* from Player where CountryID=" + index;
              OleDbDataAdapter da = new OleDbDataAdapter(cmd);
              DataSet ds = new DataSet("Player");
              OleDbCommandBuilder oldbcbr = new OleDbCommandBuilder(da);
              da.Fill(ds, "Player");
             
              
              dataGridView2.DataSource = ds;
              DataTable dt = new DataTable();
              da.Fill(dt);
      
              dataGridView2.DataSource = dt;
              try
              {
      
      
                  for (int i = 0; i <= ds.Tables\[0\].Rows.Count - 1; i++)
                  {
                      MessageBox.Show(ds.Tables\[0\].Rows\[i\].ItemArray\[0\] + " -- " + ds.Tables\[0\].Rows\[i\].ItemArray\[1\]);
      
                     
                      
                      
                      
                  }
      
      
              }
              catch (Exception ex)
              {
                  MessageBox.Show("Can not open connection ! ");
              }
      

      Pls tell me how to display data as hyperlink in gridview or using Some other Control

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      This might be of some assistance to you.

      Me, I'm dishonest. And a dishonest man you can always trust to be dishonest.
      Honestly. It's the honest ones you want to watch out for...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups