473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

programmatic database access


This is a long post. If you have answers I'm ready. If you have web
links, that'd be great too. I'm a Junior/Senior in Computer Science at
Washington State University, so you can make some assumptions about
terminology I'll be familiar with based on that.

I am trying to write a class that will abstract out database access
stuff for my application. This class will be called DBUtil
I will use this class to do the gruntwork for a custom membership
provider. I will call this class CustMemProvider.
I need help with two things. First I need help with the web.config
file. Second I need help with the programmatic access of the database.
***First, the web.config stuff: My problem with the web.config file is
that I don't understand most of the naming stuff that goes on in it.
Specifically with the ' name="<what??>" ' tag. I need to know what to
name the database. Also I need to know what to name the membership
provider when it appears in the web.config membership provider tag. I
need to know what the ConnectionString should say as well. (I've seen
the fields for these tags, but never seen a good explanation of them.)

***Now on to the custom class stuff: In my DBUtil class I will have a
static string to hold the connectionString for the connection setup. I
will hard-code the query string into each individual function. These
functions will return DataSets (to make it easier to pass the DataSet
reference out to the page) or booleans.

I prefer to use email to uniquely identify users, so I'll write my own
custom validation code as well. I need help figuring out what to do
with that. I'm assuming it's a predefined interface from the required
base class, but I need to change the fields around to pass in an email
instead of the default username, and then, of course, the password.
Also, I need to see code for the setup of a connection and the running
of a query from my module.

Is there a way to make a script or something that sets up my database
and tables when it's run? I'm thinking about future installation needs.
***As an afterthought...what the heck are stored procedures and how do
I make one?

Thank you for your help.
--
williamphenryjr

--
William
www.williamphenryjr.com
--
"Obstacles are those frightful things you see when you take your eyes
off your goal."-Henry Ford
------------------------------------------------------------------------
williamphenryjr's Profile: http://www.hightechtalks.com/m268
View this thread: http://www.hightechtalks.com/t361805

Apr 9 '06 #1
2 1749
William,

There's a custom membership provider example on MSDN that might help:
http://msdn2.microsoft.com/en-us/library/44w5aswa.aspx

It includes an example web.config that's configured to use the
provider, hopefully it demonstrates some of the different membership
configuration elements.

Stored Procedures:

A stored procedure is just a program stored within a database. It's
usually, but not always, a sequence of SQL queries, although SQL Server
2005 now supports stored procedures written in any .NET language, such
as C# or VB 2005.

SPs are usually faster than regular queries because they can be
compiled and have more direct access to your database objects. They
can be useful for encapsulating data access logic inside the database.
It's also more secure to us SPs because you are better protected from
SQL injection attacks.

SQL Data Definition Language (DDL) scripts:

It's possible to write DDL scripts in SQL that create database objects.
For example:
- CREATE TABLE
- ALTER TABLE
- CREATE INDEX
- etc.

Connection Strings:

For loads of great examples of connection strings, check out:
http://www.connectionstrings.com/

HTH,

Chris

Apr 9 '06 #2

Thanks Chris! Very helpful! You've definitely pointed me in the right
direction!
--
williamphenryjr

--
William
www.williamphenryjr.com
--
"Obstacles are those frightful things you see when you take your eyes
off your goal."-Henry Ford
------------------------------------------------------------------------
williamphenryjr's Profile: http://www.hightechtalks.com/m268
View this thread: http://www.hightechtalks.com/t361805

Apr 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dave Boyd | last post by:
Are there arguments for the built-in commands called via RunCommand such as acCmdNewObjectReport or do they always require interactive input? Is the code behind the built-in commands exposed...
19
by: Bill Cohagan | last post by:
I'm constructing an ASP page that I'd like to test by writing a program that simulates "many" users hitting the submit button on a form. I assume it's possible to manually construct an httprequest...
3
by: MikeM | last post by:
I've been trying to locate some property or method that will allow programmatic access to the "loginUrl" attribute in the web.config file in the <system.web> -> <authentication> element when the...
6
by: daver | last post by:
Hello all, I am running IIS 5.1 on Windows XP professional. I am writing a web application in C# with Visual Studio.NET. I would like to populate various data structures in my web application...
2
by: Daniel | last post by:
programmatic to ftp virtual directories when i connect to an ftp server and i only have access to a few of the ftp virtual directories, do i just change directory to them after connecting and...
6
by: Blaine Manyluk | last post by:
I have a very unusual request. I need to be able to generate reports and save them as TIF files, with full programmatic control. The application will provide the filenames. Each page of the...
1
by: shumaker | last post by:
I just need to know gnerally what commands/api I would need to look up documentation for, if this can be done at all. I have some users who take copies of an Access database home with them to do...
1
by: Demetri | last post by:
So far all the examples I've seen on the GridView gets its data declaratively using one of the Data Source controls such as the ObjectDataSource. Are there any good articles on using the GridView...
9
by: Axxe | last post by:
I have searched high and low for cogent, well-explained coding to complete a project on which I have spent six months of work. I stumbled across something on this site that is close to what I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.