Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > to use or not to use sqldatasource

Reply
Thread Tools

to use or not to use sqldatasource

 
 
JohnE
Guest
Posts: n/a
 
      01-30-2010
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
 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      01-30-2010
On Jan 30, 3:55*am, JohnE <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
 
JohnE
Guest
Posts: n/a
 
      01-30-2010
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 <(E-Mail Removed)> 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.
> .
>

 
Reply With Quote
 
JohnE
Guest
Posts: n/a
 
      01-31-2010


"Mark Rae [MVP]" wrote:

> "JohnE" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> > 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/d...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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re-use data from sqldatasource control? Mike ASP .Net 1 12-12-2006 12:44 PM
Getting error when trying to use SQLdatasource in ASP.NET 2.0 Developer ASP .Net 1 12-08-2006 12:48 PM
How to use SqlDataSource in code Donald Adams ASP .Net 1 06-20-2006 05:14 AM
use data from second sqldatasource in gridview itemtemplate? =?Utf-8?B?RGFiYmxlcg==?= ASP .Net 4 03-21-2006 06:36 AM
Declarative use of sqlDataSource in ASP.net 2.0 and Exception Hand =?Utf-8?B?SmVmZkRvdE5ldA==?= ASP .Net 1 02-02-2006 05:35 AM



Advertisments