to use or not to use sqldatasource

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

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 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.
 
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
 
Mark Rae said:
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
 
Back
Top