I have done a small c# windows application. From that, I open a sql port from my SQL Server and I use it to access my server. When the application runs on XP it's working fine.
But when I want to run it on Windows 7 it's not running... do I have to do anything special in Windows 7? Suppose my SQL port is 1868... what should I have to do with that Windows 7 machine?
Thanks for ideas...
My connection string..
Data Source=192.158.2.70,1868;initial Catalog=Accounts;User Id=janani;Password=abcd"
have you checked your firewall settings?
http://msdn.microsoft.com/en-us/library/ms175043.aspx
Related
I have made a C# application MySql Database attached I am going to use the Application on a different Computer. According to my Logic. The Mysql database is running on the localhost server of my first PC and I think that the localhost of the other PC will be different. So,My application Won't connect to the server - It's my Idea which may be wrong.
I have the following Questions :-
1.
How do I make a Mysql local server that will even work on another PC.
2.
Do I have to Install MySql on other PC ? If yes How can i include mysql setup in the Setup Wizard of my app.
3.
Do I have to make changes In the Code (Connection or anything).
Please Give any extra suggestion if you have about this.
You do not need to install mySQL on the computer that will have the app. that defeats the purpose of having a SQL Server
You will only need to change the connection string so instead of connecting to Localhost or 127.0.0.1 you will use the ip address of the machine that has the server installed. Connection Strings
I suggest you do some reading about networking, design patterns, and SQL or you risk building a very insecure application.
I have created a simple login application using the C#.net. I have some basic sql database(I use SSMS). There is name, email and password. I want my application to be usable from more devices (so I can't use localdb). Everything works fine on my pc but when I move to another, where is not installed ssms it shows error 26 - Error Locating Server/Instance Specified. I don't know how exactly to run my C# application without SQL Server Management Studio installed on client machine
I have researched for a weeks so I enable tcp/ip (from sql server manager), also add new inbound rules for tcp(1433) and udp(1434) ports in windows firewall. After that I allow remote connection and add sql server in windows firewall. Also I've tried to install SSMS on client machine but nothing
here are my conncetion strings
this one I tried to solve my problem
Data Source=xxxxxxxxxxxx;Initial Catalog=xxxxxxxxxxx;Integrated Security=SSPI
the other one is my main connection string
Data Source=xxxxxxxxxxxxxxxxxxxxxxx;Initial Catalog=xxxxxxxxxxxxxx;Integrated
Integrated Security = True
The application works fine on my computer, I've installed Visual Studio 2017 and SQL Server Management studio, but when I move to another computer it doesn't work.
Thanks to everyone in advance!!
SSMS is just a Database Management Tool, the actual Database would by SQLExpress or similar. So on your remote host you need to install the latter and set it up correctly in you application to use to appropiate connectionstring to it.
Schema compare your tables from VS and your ready to go.
https://www.microsoft.com/en-us/sql-server/sql-server-editions-express
https://www.mssqltips.com/sqlservertip/5528/installing-sql-server-2017-express/
You dont need to install sql or sql managemment studio in pc where you running your application, but just as your error said "Error Locating Server/Instance Specified", the server where you want to connect, is not accesible, thats means you should open your ports in pc where your sql server is hosted, and also, put your public ip following with that port in your server name in conectionstring, like Data Source=yourserver_IP:8076; tip: make sure your app pc and server pc are in same network.
The reason it works on the same machine is most likely is is that when you go through another machine the connection has to go through a firewall that is blocking access to SQL Server. The default port that SQL Server uses is 1433 and unless you change it on the host machine when you connect from another machine that is the port that is use to connect and you don't have to specify the port. When you connect on the same machine that SQL Server is installed the firewall does not prevent you from connecting. Port 1433 is used for the default instance (The first installed instance on the machine).
I need to take backup of windows data and its settings using C# code.
In order to achieve the goal I am running the following command:
Wbadmin start backup
SOURCE of the command
Problem:
This command is not working with all versions of Windows.
Request
Is there any other reliable way to take windows data and settings backup.
Wbadmin works on:
Windows Vista
Windows Server 2008
Windows 7
Windows 8
Windows 10
Windows Server 2008 R2
Windows Server 2012
That's a pretty standard recommended solution. What are you running into issues with beyond that?
You should be able to use something like Scenario #2 from:
https://technet.microsoft.com/en-us/library/cc742083(v=ws.11).aspx
wbadmin start backup –backupTarget:d: -include:g\folder1,h:\folder2 –systemstate -vsscopy
It would also be a good idea to take note of the syntax section
Syntax for Windows Vista and Windows Server 2008:
wbadmin start backup
[-backupTarget:{<BackupTargetLocation> | <TargetNetworkShare>}]
[-include:<VolumesToInclude>]
[-allCritical]
[-noVerify]
[-user:<UserName>]
[-password:<Password>]
[-noinheritAcl]
[-vssFull]
[-quiet]
Syntax for Windows 7 and Windows Server 2008 R2 and later:
Wbadmin start backup
[-backupTarget:{<BackupTargetLocation> | <TargetNetworkShare>}]
[-include:<ItemsToInclude>]
[-nonRecurseInclude:<ItemsToInclude>]
[-exclude:<ItemsToExclude>]
[-nonRecurseExclude:<ItemsToExclude>]
[-allCritical]
[-systemState]
[-noVerify]
[-user:<UserName>]
[-password:<Password>]
[-noInheritAcl]
[-vssFull | -vssCopy]
[-quiet]
You might have to detect the OS and run wbadmin start systemstatebackup in some scenarios. As you might notice, the systemState flag is missing from Windows Vista and Windows Server 2008. It's also important to note that wbadmin start systemstatebackup does not work on Windows 10, you will be greeted with the following message:
Warning: The DELETE SYSTEMSTATEBACKUP command is not supported in this version of Windows.
The operation ended before completion.
I have created a CRUD application that is running really well. It connects to SQL on the same machine. I want to publish my C# app and install it on another PC does not have SQL.
Is it possible to run it on that PC, without installing SQL Server on it? If so, how do I do this?
Is it possible to run it on that PC?
Without a database your application is "dead".
You have two options.
Install a sql server it this PC.
Connect to a sql server isntalled in another PC.
It's your choice.
If your project is a small one and the database is less than 4GB and you are not going to install SQL Server on every machine and your client do not have access to a Server with SQL Server then you may want to use SQL Server compact
In this case your database would be an single sdf file and you will connect to it using its path on the machine. Then the connection string would be like this:
Data Source=MyData.sdf;Max Database Size=256;Persist Security Info=False;
For more on connection string see this.
Here is the download link
In my scenario I have:
A Windows 7 machine with SQL Server 2008 Express (Database Server)
A Windows Vista machine with my software (Application Server) that reads and writes data to the Database Server.
Yesterday, after a Windows Update, my software is no longer able to access the database.
On the application server there is another program, and it accesses the same database correctly, there is also SQL Server Management Studio, and it accesses the same database correctly.
The only way I was able to reestablish the connection has been shut down the firewall on the database server.
On the database server firewall already exists a rule that allows the use of the 3 main ports used by SQL Server (1433 and the two others that i don't remember)
I tried to create a rule on application server firewall to allows my program to exit, but the problem is not that. In fact, as noted above, the problem is on firewall of the database server: turning it off fixes the problem.
I guess you need open more ports.
Please look into this :
http://msdn.microsoft.com/en-us/library/cc646023.aspx