Set SqlDataSource in code behind

Discussion in 'ASP .Net' started by staeri@gmail.com, Jan 11, 2006.

  1. Guest

    Hello!

    I would like to set the SqlDataSource in the code behind file and not
    to have it in the aspx file. How can I do that?

    Regards,

    Staeri
    , Jan 11, 2006
    #1
    1. Advertising

  2. Instantiate a SqlDataSource object in your code, probably in your
    code-behind.

    SqlDataSource sdsData = new SqlDataSource();

    There are two other constructors for SqlDataSource. Look at the MSDN
    documentation for more information.
    --
    Christopher A. Reed
    "The oxen are slow, but the earth is patient."

    <> wrote in message
    news:...
    > Hello!
    >
    > I would like to set the SqlDataSource in the code behind file and not
    > to have it in the aspx file. How can I do that?
    >
    > Regards,
    >
    > Staeri
    >
    Christopher Reed, Jan 12, 2006
    #2
    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. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    570
    Alphonse Giambrone
    Jun 28, 2003
  2. Swetha
    Replies:
    16
    Views:
    20,649
    radu_m
    Jan 7, 2009
  3. =?Utf-8?B?RG9ydGU=?=

    Gridview and SqlDatasource from code behind

    =?Utf-8?B?RG9ydGU=?=, Mar 30, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    24,764
    =?Utf-8?B?Y2xpY2tvbg==?=
    Mar 30, 2006
  4. =?Utf-8?B?RGFiYmxlcg==?=

    modify SqlDataSource parameters in code behind?

    =?Utf-8?B?RGFiYmxlcg==?=, Apr 4, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    28,302
    =?Utf-8?B?RGFiYmxlcg==?=
    Apr 4, 2006
  5. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    466
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
Loading...

Share This Page