ASP.net database connection problems

Mitchsnitchel

Active Member
Joined
Jul 14, 2009
Messages
32
Reaction score
0
Yo all!

Never used this part of the forums, but always reading up on the topics and seems like I can get some help here.

Building a website that requires inserting data into and query'ing databases. Iv done all the vb coding to complete these tasks and im pretty sure it will work. Buuuuuut it seems my connection to the database is all messed up.

At first I just added the database to the project, placing it in a new folder, but I figured there had to be more to establish a connection between my site and the database. I found in server explorer the option to add a database, and so I did. I also tested the connection in this dialog box and the connection succeeded.

The problem arises when I run the site, and try to enter the specific data i want to see in the database to observe my masterpiece at work. the operation fails however and the page explains that the connection could not initialize. Code stops at:

dbConnection.open()

obviously I am not adding the database to the site properly. Is their known problems with creating database connections to access2007 database's?
What am I missing, all Id like to know is how to add the database to my website properly.
Hope all can kinda understand my problem, and that I'l get at least 300 responses :erm:

Have a good day
 
This is a little out of my league but here is my 5c.

My technical background is more network admin sort of with a bit of development thrown in (sorta, it's complicated lol), but reading your post kinda flags something from that side of things.

Access 2007 is a flat DB without a client-server interface system (unlike MSSQL or MySQL Server). Depending on what class dbConnection.open is that might be the issue in itself. I would suggest playing the different OBDC drivers or even trying DSN-related stuff.

It might also be something as simple as the the file permissions on the database being insufficient for the .Net process.

Even better would be looking at a full-featured database (though I hate MSSQL and MySQL is owned by the devil now).
 
not one reply.... :twisted:

btw Im using visual studio 2010 web developer

If you gave more specifics, such as the actual error you receive, as well as some code samples (like what you did to set up the database connection) you may get more replies. That, and most of us use SQL Server/MySQL almost exclusively. Access doesn't really count unless you're a student. :erm:
 
Raithlin said:
If you gave more specifics, such as the actual error you receive, as well as some code samples (like what you did to set up the database connection) you may get more replies.

+1

Raithlin said:
Access doesn't really count unless you're a student.

+100 ... Wonder if they've heard of SQL Express.
 
download MS SQL Express, it's free,
install it
then open your access database and migrate the database with all the tables and data to MS SQL Express
then add a web config to your asp.net project...

the web config connection sting should look like this.

<configuration>
<connectionStrings>
<add name="DatabaseCon" connectionString="Data Source=yourSQLserver\SQLEXPRESS;Initial Catalog=Databasename;User ID=sa; Password=password;"/>
</connectionStrings>
</configuration>
 
Top
Sign up to the MyBroadband newsletter
X