to use or not to use sqldatasource

Discussion in 'ASP .Net' started by JohnE, Jan 30, 2010.

  1. JohnE

    JohnE Guest

    I am a newbie at this so I am spending time at night learning all I can of
    asp.net. I read the information on line plus in books and they make
    reference to sqldatasource. They also make reference to coding the
    connection, etc in C# in the code behind. I have a connection string in the
    webconfig file but my question pertains to the way to use it. It is getting
    confusing. What is the proper / best way to work with connection strings and
    all that goes it (da, dt, ds, etc), use a sqldatasource or thru code behind
    or both? And why?

    Thanks...John
    JohnE, Jan 30, 2010
    #1
    1. Advertising

  2. On Jan 30, 3:55 am, JohnE <> wrote:
    > I am a newbie at this so I am spending time at night learning all I can of
    > asp.net.  I read the information on line plus in books and they make
    > reference to sqldatasource.  They also make reference to coding the
    > connection, etc in C# in the code behind.  I have a connection string in the
    > webconfig file but my question pertains to the way to use it.  It is getting
    > confusing.  What is the proper / best way to work with connection strings and
    > all that goes it (da, dt, ds, etc), use a sqldatasource or thru code behind
    > or both?  And why?
    >
    > Thanks...John


    I always do this thru the code behind. It makes it easy for me. Using
    sqldatasource is more "declarative" than programmatic scenario.
    Depending on the requirements and experience sqldatasource could be a
    good advantage too.
    Alexey Smirnov, Jan 30, 2010
    #2
    1. Advertising

  3. JohnE

    JohnE Guest

    Thanks. It is an Access 2007 db that is getting converted over. It turns
    out not to be as large as first thought. About 6 - 8 people will be using it
    and it isn't that much of a complicated conversion. So the sqldatasource
    might be the simpliest method to use. Probably not so for the next one to
    convert.

    Now if I can only get the A2007 data over to sql server 2005 I would be
    happy. You wouldn't happen to have any good scripts to use? The sql import
    does not bring it over, that ssma2005 application will not bring all the
    tables, A2007 upsizing wizard is worthless.

    Anyway, thanks for the reply.

    John



    "Alexey Smirnov" wrote:

    > On Jan 30, 3:55 am, JohnE <> wrote:
    > > I am a newbie at this so I am spending time at night learning all I can of
    > > asp.net. I read the information on line plus in books and they make
    > > reference to sqldatasource. They also make reference to coding the
    > > connection, etc in C# in the code behind. I have a connection string in the
    > > webconfig file but my question pertains to the way to use it. It is getting
    > > confusing. What is the proper / best way to work with connection strings and
    > > all that goes it (da, dt, ds, etc), use a sqldatasource or thru code behind
    > > or both? And why?
    > >
    > > Thanks...John

    >
    > I always do this thru the code behind. It makes it easy for me. Using
    > sqldatasource is more "declarative" than programmatic scenario.
    > Depending on the requirements and experience sqldatasource could be a
    > good advantage too.
    > .
    >
    JohnE, Jan 30, 2010
    #3
  4. JohnE

    JohnE Guest

    "Mark Rae [MVP]" wrote:

    > "JohnE" <> wrote in message
    > news:...
    >
    > > I am a newbie at this so I am spending time at night learning all I can of
    > > asp.net. I read the information on line plus in books and they make
    > > reference to sqldatasource. They also make reference to coding the
    > > connection, etc in C# in the code behind. I have a connection string in
    > > the
    > > webconfig file but my question pertains to the way to use it. It is
    > > getting
    > > confusing. What is the proper / best way to work with connection strings
    > > and
    > > all that goes it (da, dt, ds, etc), use a sqldatasource or thru code
    > > behind
    > > or both? And why?

    >
    > I would suggest that you forget all about these "training wheels" controls
    > and build yourself a DAL (data abstraction layer) based on the factory
    > pattern.
    >
    > Microsoft's DAAB is a good place to start:
    > http://www.microsoft.com/downloads/...8B-2986-47F7-B529-3E41584B6CE5&displaylang=en
    >
    > This will allow you to support more than one RDBMS with the same DAL. Mine
    > currently supports SQL Server, SqlCe, Jet (which some people call Access),
    > Oracle and MySql. It can be dropped completely unmodified into any WinForms
    > or WebForms project.
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    >
    > .
    >


    Thanks for the info. But training wheels are good for starters. Got to
    crawl before you can walk. Got to walk before you can run. And with what is
    being converted over, it is also a learning tool.

    John
    JohnE, Jan 31, 2010
    #4
    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. =?Utf-8?B?SmVmZkRvdE5ldA==?=

    Declarative use of sqlDataSource in ASP.net 2.0 and Exception Hand

    =?Utf-8?B?SmVmZkRvdE5ldA==?=, Feb 1, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,861
    Steven Cheng[MSFT]
    Feb 2, 2006
  2. =?Utf-8?B?RGFiYmxlcg==?=

    use data from second sqldatasource in gridview itemtemplate?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 20, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    4,057
    =?Utf-8?B?RGFiYmxlcg==?=
    Mar 21, 2006
  3. Donald Adams

    How to use SqlDataSource in code

    Donald Adams, Jun 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    5,846
    Donald Adams
    Jun 20, 2006
  4. Developer
    Replies:
    1
    Views:
    281
    Peter Bradley
    Dec 8, 2006
  5. Mike
    Replies:
    1
    Views:
    365
Loading...

Share This Page