Community discussion forum

how to get all employee ids into array?

Tags: .net, asp.net, db India
  • 2 months ago

    hai all,
        i am new to .net.i am using .net 2005.i do my project in asp.net.backend is sql2000.
    all employee ids are stored in sql 2000 database.
    i want to get all employee ids from database and stored into single array name.then using that array name,i want to display the details of all employee ids in datagridview....how to do this?....
    thanks in advance...

  • Advertisement

    Simply the fastest line-level profiler for .NET ever

    “The low overhead means it has minimal impact on the execution of my program”
    Mark Everest, Development Team Leader, Renault F1 Team Ltd.

    Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now

  • 2 months ago

    Hi,

    I dont think you need to use an array, a dataset will do the job for you.

    you could use a construct such as this (you will need to tailor this to your scenario - i develop in oracle, so forgive me if i get some of the classes wrong)

    [CODE]

    Dim sqlDS as dataset = new dataset 
    using sqlConn as SQLConnection = new SQLConnection({your connection string here})
    using sqlCom as SQLCommand = new SQLCommand({Your select SQL here}, sqlConn)
    using sqlAdapter as sqlDataAdapter = new sqlDataAdapter(sqlCom)
    sqlCom.Connection.Open()
    sqlAdapter.fill(sqlDS)
    sqlCom.Connection.Close
    End Using
    End Using
    End Using
    gdvDetails.datasource= sqlDS
    gdvdetails.DataBind()

    [/CODE]

    Does that make sense?

    Regards

    Simon C

Post a reply

Enter your message below

Sign in or Join us (it's free).