New Application Installation - SQL DB

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

I am getting ready to create my very first install of a C# application. I
have never done this before, so pardon if my questions are somewhat basic.

My install required a database to be - in place and I was wanting to test
if the database was present, if if not present, install it.

How do I test is SQL Server is installed on the machine?
I have a stored procedure for restoring the database if it is not present,
but What how do you go about supplying the connection string, when it would
appear that I have to identify the Database in the connection string, as
database which is not present?

How do I invoke this "checker and SQL Server DatabaseInstaller routine" as
part of the installation process?

Thanks in advance for your assistance!!!!!!!
 
Jim Heavey said:
I am getting ready to create my very first install of a C# application. I
have never done this before, so pardon if my questions are somewhat basic.

My install required a database to be - in place and I was wanting to test
if the database was present, if if not present, install it.

How do I test is SQL Server is installed on the machine?
I have a stored procedure for restoring the database if it is not present,
but What how do you go about supplying the connection string, when it would
appear that I have to identify the Database in the connection string, as
database which is not present?

How do I invoke this "checker and SQL Server DatabaseInstaller routine" as
part of the installation process?

Thanks in advance for your assistance!!!!!!!

You could use SQLDMO but, I think that requires COM interop.
SQLDMO allows you to enumerate SQL servers & databases and perform
backup/restores.
I'm just picking up C# myself so maybe someone more seasoned in C# has a
better answer.
I'm also interested to see any ideas.
Good luck
 
Back
Top