Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP.NET (Non-Forum Related)
 Just do it! Nike
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Suamere
Starting Member

27 Posts

Posted - 03 January 2005 :  09:56:48  Show Profile  Visit Suamere's Homepage  Send Suamere an AOL message  Send Suamere a Yahoo! Message
So I've read every single ASP tutorial in the world. They are ALL VERY Vague about connecting to databases. In a thousand page tutorial, there might be a paragraph on it. What do I gots to do to get someone to build me an ASP.net page? Then I could use that one page and mold the rest of my code around it... This is my info:

Database Name: HRPDB.mdb
Location: Root Folder -> db
ODBC DSN: HRPDB
Web Page Location: Root Folder -> wwwroot
Table Name: Members (Field1, Field2)

Text Box -> Input into Field 1
Text Box -> Input into Field 2
Submit Button

It's amazing how complex people can make code in order for this to be accomplished. Simply inputing a new record with two spaces into a table of a database from a dynamic web site (phew). I don't need uber long code or validations or anything. I can pretty much add anything I need. I basically just need a layout and DSN connection. The DSN really gets me for some reason. Thanks for taking the challenge if you do.

If something goes wrong, find the source of the problem and break it's legs.

redbrad0
Advanced Member

USA
3725 Posts

Posted - 03 January 2005 :  14:12:56  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Have you looked at http://asp101.com/samples/db_add_aspx.asp

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Suamere
Starting Member

27 Posts

Posted - 03 January 2005 :  14:47:29  Show Profile  Visit Suamere's Homepage  Send Suamere an AOL message  Send Suamere a Yahoo! Message
Yeah, thanks though. I've read everything on asp101, and on many other asp sites with tutorials. Maybe it's just me, I actually have that file you linked me to as a possibility on my page. It's http://www.HyruleRP.com/MemberForm2.asp
But still, no connection. I know there is something wrong with the DSN part, because if I delete everything and just put a resonse.write there for confirmation, the page won't load. It's nerve wracking when you THINK You know everything you need to, but you don't understand the first initial part. dam DSN. But anyway, I'm having my server people look into why I can't get a connection, maybe it isn't me...

If something goes wrong, find the source of the problem and break it's legs.
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 03 January 2005 :  16:59:59  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I know nothing about .NET but if your trying to run a .NET page why does it have a .asp extension instead of .aspx?

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Suamere
Starting Member

27 Posts

Posted - 03 January 2005 :  22:39:18  Show Profile  Visit Suamere's Homepage  Send Suamere an AOL message  Send Suamere a Yahoo! Message
Very, VERY Clever, lol. Okay, so I changed it to MemberForm2.aspx. This is just one of many of my failed attempted files, I guess I got it mixed up with asp. Still, No DSN Connection. Perhaps the problem lies in a Namespace. I don't understand that.. is there a file I need called System.data.OleDB? Or is that just included automatically when I put in the "Include Namespace" Code. I can't seem to find a copy of any "Namespaces" to download anywhere so I could put it into my web site... No?

If something goes wrong, find the source of the problem and break it's legs.
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 04 January 2005 :  00:51:48  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I will leave this question for someone that knows about .NET to answer. Sorry I do not know anything else about .NET extept the extension :)

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 05 January 2005 :  03:23:17  Show Profile  Visit Nathan's Homepage
Put
using System.Data.OleDb;
at the top of your C# file

OR

<%@ Import Namespace="System.Data.OleDb" %>
at the top of your .aspx file

That is all you need to use the classes in the OleDb namespace.

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

JamesCurran
Starting Member

USA
13 Posts

Posted - 05 January 2005 :  11:02:01  Show Profile  Visit JamesCurran's Homepage
quote:
Originally posted by Suamere

So I've read every single ASP tutorial in the world. They are ALL VERY Vague about connecting to databases. In a thousand page tutorial, there might be a paragraph on it. What do I gots to do to get someone to build me an ASP.net page? Then I could use that one page and mold the rest of my code around it... This is my info:

Database Name: HRPDB.mdb
Location: Root Folder -> db
ODBC DSN: HRPDB
Web Page Location: Root Folder -> wwwroot
Table Name: Members (Field1, Field2)

I basically just need a layout and DSN connection. The DSN really gets me for some reason.


Forget the DSN. ODBC is old school. You don't need it.

Your connection string should be:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db\HRPDB.mdb;User Id=admin;Password=;"

All together, you'll probably want something like:


OleDbConnection myConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db\northwind.mdb;User Id=admin;Password=;" );
OleDbDataAdapter myCommand = new OleDbDataAdapter("Select LastName, FirstName from Employees", myConnection);

DataSet ds = new DataSet();
myCommand.Fill(ds);


Truth,
James Curran
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07