Turn on more accessible mode
Skip to main content
Turn off more accessible mode
Comp410
>
Fall 2007
Sign In
|
Fall 2007
This Site: Fall 2007
Fall 2007
Customer Resource Site
Fall 2007
>
Announcements
>
Using Sql in the Backend
Announcements
: Using Sql in the Backend
Title
Using Sql in the Backend
Body
Most of you shouldn't need to do this, but if you need to execute a SQL command within the backend, please follow the following guidlines from now on:
You should not ever need to reference any specific provider's namespace. This means that you should not have using System.Data.SqlClient.
Your command should be a reference to an IDbCommand, which you can get by DatabaseFactory.CreateCommand.
To add parameters to this command, use c.Parameters.Add(), along with the helper function DatabaseFactory.CreateParam which creates the parameter to add. Look at any other database command execution for an example.
To get a reader, you still just call c.ExecuteReader() but the reader will have type IDataReader instead of SqlDataReader.
I think this is all you should need to know. Email if you have questions.
Expires
Links
Attachments
Created at 12/4/2007 5:33 PM by Bradley D. Dodson
Last modified at 12/4/2007 5:33 PM by Bradley D. Dodson
Use this page to add attachments to an item.
Name