Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > how to publish database in my win application project
 

how to publish database in my win application project

hi.i have a win application which is works fine in my computer. i have used database and my connection string in it.i publish it as a win app on my desktop and install the setup file.it works in my machin but when i test it in another computer (i need it so) and i also installed requierments for it ,it will install there too,but it can not connect to my application database and gives me error.i know i have to set something in my project properties and changhe client application services.but how? how can i use my database in offline mode.i mean in another machines too.pleeeeeeeeease help me
softnet1  Thursday, May 21, 2009 1:03 PM
hi.i finally found my answer.i do not need any sql server or publishing.i should just make a .msi or exe file for my program.the whole answer is here for anyone who wants to know.just follow steps and enjoy:

regards
softnet1  Monday, May 25, 2009 5:15 PM
hi.i have a win application which is works fine in my computer. i have used database and my connection string in it.i publish it as a win app on my desktop and install the setup file.it works in my machin but when i test it in another computer (i need it so) and i also installed requierments for it ,it will install there too,but it can not connect to my application database and gives me error.i know i have to set something in my project properties and changhe client application services.but how? how can i use my database in offline mode.i mean in another machines too.pleeeeeeeeease help me.
softnet1  Thursday, May 21, 2009 1:01 PM
You can't use a database in offline mode. Chances are you don't have the connection string properly set up on the other computer, or else your database isn't set up to accept remote connections. We'll need to know more about your database setup before we can help you any more with this.
David Morton - http://blog.davemorton.net/ - @davidmmorton
David M Morton  Thursday, May 21, 2009 1:18 PM
hi.let me tell you more details.i have an application which get data from a device and draw the input data as a line graph.i am working with vs 2008 ,.net framework 3.5 sp1 and i draw my chart with mschart control.my connectionstring is like this :

connectionString

="Data Source=username\SQLEXPRESS;Initial Catalog=mydatabase;Integrated Security=True"
i know it is for just my machine as the server of my program,but i have to use my application in some other machin to get data and draw line graph.what is the settings?i have read this
http://msdn.microsoft.com/en-us/library/bb384312.aspx
but i do not know which steps i should do about my database.please help me.it could work but i do not know.help me.

softnet1  Thursday, May 21, 2009 3:28 PM

Can the machine you're trying to use this on resolve your machine? Try going to the command prompt on the machine you're trying to install on, and type "ping <machinename>" where <machinename> is the name of your computer.


David Morton - http://blog.davemorton.net/ - @davidmmorton
David M Morton  Thursday, May 21, 2009 3:30 PM
so what do you mean from this?i got confused??????
softnet1  Thursday, May 21, 2009 3:36 PM

I'm trying to make sure the other computer can even connect to your computer at all.

On your machine:

1. Right click on My Computer.
2. Click "Properties".
3. Click the "Computer Name" tab.
4. Write down the name next to the "full computer name".

On the machine where you're trying to install the application:

1. Press the Windows Button+R at the same time.
2. Type in "cmd".
3. When the window comes up, type in "ping", then type one space, then type in what you wrote down in step 4 of the last set of instructions.
4. Let me know if you see anything that says "Request Timed Out". If you do, the other computer will be unable to use the database on your computer until you fix your network issues.


David Morton - http://blog.davemorton.net/ - @davidmmorton
David M Morton  Thursday, May 21, 2009 3:40 PM
no it works ok and does not say that..no timeout.
softnet1  Thursday, May 21, 2009 4:12 PM
Ok. Another thing I noticed was Integrated Security was set to true. Are you certain that the user logged in on the system you're trying to install on has permissions to log into your machine? Chances are, they don't.

1. Open SQL Server management studio on your computer. Connect to your SQL Express database instance.
2. Under the "Security" folder, right click on "Logins" and click "New Login".
3. When the window comes up, enter the login name, then click the radio button next to SQL Server Authentication. Enter a password for the user. Go ahead and uncheck User must change password at next login.
4. Click OK.

For your connection string, remove Integrated Security = true, and change it to:

User=<username>; Password=<password>

instead.

Make sure the "username" listed for Data Source in your connection string references your computer name (which you got from step 4 above), followed by a backslash and the database instance, (ie "SuperComputer\SQLEXPRESS");

By the way, I should have asked this earlier... what is the exact error message you're receiving?
David Morton - http://blog.davemorton.net/ - @davidmmorton
David M Morton  Thursday, May 21, 2009 4:20 PM
when i installed the app in another machin,it installs fine,but when want to connect to database it says : login failed for SuperComputer\SQLEXPRESS .SuperComputer is the name of the computer i have deployed my project.please see this post .this is what i want to do exactly but i could not understand what to do and how copy my database as they said and about connection string.it is this post:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/12adafb2-d948-4658-aa9d-5208fe5aca7a
thanks a lot
softnet1  Thursday, May 21, 2009 5:13 PM

SuperComputer was just an example name. You would use SuperComputer if the name of your computer happened to be SuperComputer.

See this post:

http://social.msdn.microsoft.com/Forums/en-US/Vsexpressinstall/thread/aaf2f68c-4a40-44c8-b7ee-b2f5d94e23c3


David Morton - http://blog.davemorton.net/ - @davidmmorton
David M Morton  Thursday, May 21, 2009 6:18 PM
You should probably ask this question here:

ClickOnce and Setup & Deployment Projects
John Grove - TFD Group, Senior Software Engineer, EI Division, http://www.tfdg.com
JohnGrove  Thursday, May 21, 2009 8:34 PM
hi.i finally found my answer.i do not need any sql server or publishing.i should just make a .msi or exe file for my program.the whole answer is here for anyone who wants to know.just follow steps and enjoy:

regards
softnet1  Monday, May 25, 2009 5:15 PM

You can use google to search for other answers

Custom Search

More Threads

• Smart client template solution ???
• User Submitted Improvements
• Installation aborts: "The parameter is incorrect"
• e-mailing
• problem logging on
• Installer is no longer responding
• Terrarium Servers Down For Maintenance
• Is the third light supposed to be red?
• All Green Lights and No Critters
• When will Terrarium work with C# Express?