Click here to Skip to main content
15,898,588 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to rename a table in a database? Pin
DiWa17-Apr-03 2:44
DiWa17-Apr-03 2:44 
GeneralRe: How to rename a table in a database? Pin
Paul Selormey17-Apr-03 3:18
Paul Selormey17-Apr-03 3:18 
AnswerRe: How to rename a table in a database? Pin
Bruce Duncan17-Apr-03 1:14
Bruce Duncan17-Apr-03 1:14 
GeneralRe: How to rename a table in a database? Pin
Paul Selormey17-Apr-03 1:20
Paul Selormey17-Apr-03 1:20 
GeneralSQL Server AND Access Pin
theJazzyBrain16-Apr-03 13:13
theJazzyBrain16-Apr-03 13:13 
GeneralRe: SQL Server AND Access Pin
Paul Selormey17-Apr-03 0:55
Paul Selormey17-Apr-03 0:55 
GeneralRe: SQL Server AND Access Pin
theJazzyBrain17-Apr-03 1:53
theJazzyBrain17-Apr-03 1:53 
GeneralRe: SQL Server AND Access Pin
Paul Selormey17-Apr-03 2:36
Paul Selormey17-Apr-03 2:36 
theJazzyBrain wrote:
And you do I work with the interfaces? Any sample code?
IDbConnection connection = new OleDbConnection(str);

IDbConnection connection = new SqlConnection(str);

Should work for you. You can later do something like
IDbCommand atrCommand = connection.CreateCommand();


theJazzyBrain wrote:
If I do that, will I still have the advantages that SQLClient provides when using SQL Server. Because, the app will initially be aimed for SQL server 2000, but we are planning for a Light version which works with Access in order to cut down costs for customers.

If you wish to do SQL Server or for that matter any provider specific stuff, store the connection type somehow so that you can cast the pointer to the appropriate class later.
private IDbConnection conn = null;
private Type connType = null;

SqlConnection connection = new SqlConnection(str);

conn = (IDbConnection)connection;

connType = connection.GetType();

then later, you can do something like
if (connType == typeof(SqlConnection))
    SqlConnection sqlConn = (SqlConnection)conn;
else if (...)
{}

theJazzyBrain wrote:
Do you think we should try and make a component to handle all the provider-independed access?

It depends on your needs. The central point here is the connection object, so provide a means of obtaining the interface where you wish to work in provider-independent manner.

Best regards,
Paul.


Jesus Christ is LOVE! Please tell somebody.
GeneralRe: SQL Server AND Access Pin
theJazzyBrain17-Apr-03 2:45
theJazzyBrain17-Apr-03 2:45 
GeneralSQL server: Updating a table from itself... Pin
Member 9616-Apr-03 10:57
Member 9616-Apr-03 10:57 
GeneralRe: SQL server: Updating a table from itself... Pin
DiWa16-Apr-03 21:49
DiWa16-Apr-03 21:49 
GeneralRe: SQL server: Updating a table from itself... Pin
Member 9617-Apr-03 6:07
Member 9617-Apr-03 6:07 
GeneralINNER JOIN and regular joins Pin
Reno Tiko16-Apr-03 10:07
Reno Tiko16-Apr-03 10:07 
GeneralRe: INNER JOIN and regular joins Pin
Member 9616-Apr-03 10:47
Member 9616-Apr-03 10:47 
GeneralRe: INNER JOIN and regular joins Pin
Bruce Duncan16-Apr-03 19:31
Bruce Duncan16-Apr-03 19:31 
GeneralRe: INNER JOIN and regular joins Pin
Richard Deeming16-Apr-03 23:26
mveRichard Deeming16-Apr-03 23:26 
GeneralStarting MSDE on Win9x Pin
Diego Mijelshon16-Apr-03 9:31
Diego Mijelshon16-Apr-03 9:31 
GeneralPassing DB Name As SProc Parameter Pin
perlmunger16-Apr-03 5:34
perlmunger16-Apr-03 5:34 
GeneralSQL query Pin
John-theKing16-Apr-03 2:02
John-theKing16-Apr-03 2:02 
GeneralRe: SQL query Pin
John Honan16-Apr-03 3:55
John Honan16-Apr-03 3:55 
GeneralRe: SQL query Pin
John-thKing16-Apr-03 4:48
sussJohn-thKing16-Apr-03 4:48 
GeneralRe: SQL query Pin
John Honan16-Apr-03 4:54
John Honan16-Apr-03 4:54 
GeneralRe: SQL query Pin
greg lynch _nj_17-Apr-03 3:07
greg lynch _nj_17-Apr-03 3:07 
GeneralRe: SQL query Pin
si_6917-Apr-03 5:08
si_6917-Apr-03 5:08 
GeneralDummies guide to SQL Pin
Michael P Butler15-Apr-03 23:14
Michael P Butler15-Apr-03 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.