Maybe you can help me convert my data access code from VB to C#.
In VB I have the following code snippets:
Set Con = Server.CreatObject("ADODB.Connection");
Con.Open "MyDataBase.mdb"
SET RecSet = Con.Execute(someSqlString)
If RecSet.BOF Or RecSet.EOF Then ....
RecSet.Close
Can you tell me where to find the C# equivalents?
A good example would be very helpful.
Also, Since I'm developing in VS 2008 using an ASP.NET Web Application
Project how do you address the database file so that the code will working
when debugging as well as when its published to the web site? Is
"~/MyDataBase.mdb" appropriate.
Thanks for any help you can render,
Neil
Miha Markic said:
Right, Access should be dumped asap.
Besides SQL Express, which requires installation, there is another very
appealing database engine: SQL Compact Edition - subset of SQL Server, no
install whatsoever required - besides copying (I think) three assemblies.
It
isn't multiuser, but for a single application should do just fine.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development
www.rthand.com
Blog:
http://cs.rthand.com/blogs/blog_with_righthand/
Marc Gravell said:
So why would Microsoft release their new query solution without
support
for
one of their most popular databases???
Popular with who? Probably not the same set of people who might be
using LINQ. It just about works for single user (OK, maybe a handful
of users) in a destkop app, but you aren't really going to use LINQ
inside such. And if you don't need the desktop app side of things, SQL
Express makes a good choice... with far fewer of Access's
limitations...
But this is one of those polarizing things. Personally I wouldn't
recommend access, but that might just be me.
Marc