J
Jonas L
I'm creating a application that should handle contacts, orders etc.
I want to distribute only the exe file and let the application take
care of creating and changing the database that is to be used.
Furthermore, I would also like to make it possible for the user to
select which sort of database to create and use, MSSQL, Oracel, Access
etc.
Is this possible? Or do I have distribute a databas file as well? My
first idea was to use OLEDB and let the user select which provider to
use, but I can't open a databas connection without a valid database
file.
Something simular to this..
Assume that the string aConnectionString would equal
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User
Id=admin;Password=;"
or "Provider=sqloledb;Data Source=Aron1;Initial
Catalog=pubs;Integrated Security=SSPI;"
or "Provider=MySQLProv;Data Source=mydb;User
Id=UserName;Password=asdasd;"
OleDbConnection oConnection = new OleDbConnection(aConnectionString);
OleDbCommand oCommand = new OleDbCommand("create database
aDbName",oConnection);
oConnection.Open();
oCommand.ExecuteNonQuery();
oConnection.Close();
Br
Jonas
I want to distribute only the exe file and let the application take
care of creating and changing the database that is to be used.
Furthermore, I would also like to make it possible for the user to
select which sort of database to create and use, MSSQL, Oracel, Access
etc.
Is this possible? Or do I have distribute a databas file as well? My
first idea was to use OLEDB and let the user select which provider to
use, but I can't open a databas connection without a valid database
file.
Something simular to this..
Assume that the string aConnectionString would equal
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User
Id=admin;Password=;"
or "Provider=sqloledb;Data Source=Aron1;Initial
Catalog=pubs;Integrated Security=SSPI;"
or "Provider=MySQLProv;Data Source=mydb;User
Id=UserName;Password=asdasd;"
OleDbConnection oConnection = new OleDbConnection(aConnectionString);
OleDbCommand oCommand = new OleDbCommand("create database
aDbName",oConnection);
oConnection.Open();
oCommand.ExecuteNonQuery();
oConnection.Close();
Br
Jonas