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. Web Development
  3. ASP.NET
  4. Retrieve sqlserver instances Problem

Retrieve sqlserver instances Problem

Scheduled Pinned Locked Moved ASP.NET
helpquestion
3 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.
  • P Offline
    P Offline
    pampam110
    wrote on last edited by
    #1

    I have two instance name for SqlServer. I write this code :

    SqlDataSourceEnumerator sqlserver = SqlDataSourceEnumerator.Instance;
    DataTable dt = sqlserver.GetDataSources();
    GridView1.DataSource = dt;
    GridView1.DataBind();

    but when i run it , i couldn't see the result! What Should i Do?

    []D @ []v[] []D @ []v[]

    modified on Thursday, May 7, 2009 8:23 PM

    A 1 Reply Last reply
    0
    • P pampam110

      I have two instance name for SqlServer. I write this code :

      SqlDataSourceEnumerator sqlserver = SqlDataSourceEnumerator.Instance;
      DataTable dt = sqlserver.GetDataSources();
      GridView1.DataSource = dt;
      GridView1.DataBind();

      but when i run it , i couldn't see the result! What Should i Do?

      []D @ []v[] []D @ []v[]

      modified on Thursday, May 7, 2009 8:23 PM

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      pampam110 wrote:

      but when i run it , i couldn't see the result! What Should i Do?

      Did you debug your code? What dt returns ?

      cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net

      P 1 Reply Last reply
      0
      • A Abhijit Jana

        pampam110 wrote:

        but when i run it , i couldn't see the result! What Should i Do?

        Did you debug your code? What dt returns ?

        cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net

        P Offline
        P Offline
        pampam110
        wrote on last edited by
        #3

        thanks for reply :thumbsup: i named my datatable as dt, and put all sqlserver instance name in that. and then try to fill it in gridview! yeah, i debug it! but it didn't show any result. any idea?

        []D @ []v[] []D @ []v[]

        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