SqlDataSource Data, Can not get to it

Discussion in 'ASP .Net' started by LVP, Jan 3, 2008.

  1. LVP

    LVP Guest

    Hi,

    I have a sqldatasource01 configured properly and can databind it to a
    CheckBoxList and see data with no problem.

    How can I get the data programmatically from the sqldatasource01
    I need to loop through it. and get the extra columns passed in the
    sqldatasource01
    I don't want to loop through the CheckBoxList because it does not have all
    the extra columns.

    Can I do this with one sqldatasource and not two.

    help

    thanks

    LVP
    LVP, Jan 3, 2008
    #1
    1. Advertising

  2. LVP

    Phil H Guest

    Re: SqlDataSource Data, Can not get to it

    On 3 Jan, 19:47, "LVP" <> wrote:
    > Hi,
    >
    > I have a sqldatasource01 configured properly and can databind it to a
    > CheckBoxList and see data with no problem.
    >
    > How can I get the data programmatically from the sqldatasource01
    > I need to loop through it. and get the extra columns passed in the
    > sqldatasource01
    > I don't want to loop through the CheckBoxList because it does not have all
    > the extra columns.
    >
    > Can I do this with one sqldatasource and not two.
    >
    > help
    >
    > thanks
    >
    > LVP


    Hi

    The SqlDataSource component is really for binding directly to web
    server controls at design time to save coding. I think you'll find
    that the internal data structures of those components aren't really
    accessible in code.

    If you require programmatic access to SQL data tables (and you don't
    want to write reams of code using the traditional components in the
    System.Data.SqlClient name space) then try adding a DataSet to the
    project. A wizard will take you through the process of setting up a
    TableAdapter (a new version of the old SqlDataAdapter) and DataTable
    defined in an XSD file (which by default will go in the App_Code
    folder).

    New namespaces will be added to your project containing objects for
    the TableAdapter and DataTable which can be created and used as
    required (DataViews then can be created and used in the normal
    manner). Whatever columns you require can be exposed in the Select
    statement (the wizard can bring up QueryBuilder if you wish to
    construct it visually). The DataTable can also be used as the
    datasource for the CheckBoxList if you like so that only one
    datasource is used, but the binding process will require some
    programmatic intervention. Try it and see.
    Phil H, Jan 3, 2008
    #2
    1. Advertising

  3. LVP

    LVP Guest

    Re: SqlDataSource Data, Can not get to it

    Phil,

    I will follow your recommendations and see where I get stuck next.

    I appreciate you taking the time to explain this.

    much thanks,

    LVP


    "Phil H" <> wrote in message
    news:...
    > On 3 Jan, 19:47, "LVP" <> wrote:
    >> Hi,
    >>
    >> I have a sqldatasource01 configured properly and can databind it to a
    >> CheckBoxList and see data with no problem.
    >>
    >> How can I get the data programmatically from the sqldatasource01
    >> I need to loop through it. and get the extra columns passed in the
    >> sqldatasource01
    >> I don't want to loop through the CheckBoxList because it does not have
    >> all
    >> the extra columns.
    >>
    >> Can I do this with one sqldatasource and not two.
    >>
    >> help
    >>
    >> thanks
    >>
    >> LVP

    >
    > Hi
    >
    > The SqlDataSource component is really for binding directly to web
    > server controls at design time to save coding. I think you'll find
    > that the internal data structures of those components aren't really
    > accessible in code.
    >
    > If you require programmatic access to SQL data tables (and you don't
    > want to write reams of code using the traditional components in the
    > System.Data.SqlClient name space) then try adding a DataSet to the
    > project. A wizard will take you through the process of setting up a
    > TableAdapter (a new version of the old SqlDataAdapter) and DataTable
    > defined in an XSD file (which by default will go in the App_Code
    > folder).
    >
    > New namespaces will be added to your project containing objects for
    > the TableAdapter and DataTable which can be created and used as
    > required (DataViews then can be created and used in the normal
    > manner). Whatever columns you require can be exposed in the Select
    > statement (the wizard can bring up QueryBuilder if you wish to
    > construct it visually). The DataTable can also be used as the
    > datasource for the CheckBoxList if you like so that only one
    > datasource is used, but the binding process will require some
    > programmatic intervention. Try it and see.
    >
    LVP, Jan 4, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. michelle
    Replies:
    3
    Views:
    7,050
    Tapio Kulmala
    Feb 14, 2006
  2. VB Programmer

    SqlDataSource - how get first row in SELECT?

    VB Programmer, Feb 22, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    8,587
    Patrick.O.Ige
    Feb 23, 2006
  3. =?Utf-8?B?VmVhcg==?=
    Replies:
    1
    Views:
    5,026
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Mar 21, 2006
  4. Dave
    Replies:
    3
    Views:
    15,049
    Siva M
    Aug 13, 2006
  5. Vaidas Gudas

    how to get data from sqldatasource

    Vaidas Gudas, Oct 5, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    309
    Vaidas Gudas
    Oct 5, 2006
Loading...

Share This Page