简体   繁体   中英

Create SQL Server database during application installation

I have following this link to create my SQL Server database during installation of my Winforms application. But I got this error :

Value cannot be null. Parameter name : Stream

Note : my connection string is

Data Source=MyServerName\SQLEXPRESS;Initial Catalog=master;Integrated Security=SSPI;

and also my database should create on server.

Please ask me if any thing is unclear...

I bet that the error raises on this row:

Stream strm = Asm.GetManifestResourceStream(Asm.GetName().Name + "." + Name);

You need to have a file named sql.txt in your project and you need to edit its properties and set its build action to embedded resource

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM