Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
retarder testing machine consists of sensors on it, data from this system are uploaded to the server these are already done before, now I want to build a windows application and get the data from the remote server and have a GUI of the data, getting the data from the remote database is an issue. step voice what I need to do?

What I have tried:

I have used MySQL as a database and C# for windows form and made tables for sensor's data with the columns (ID, Pressure, Displacement, Time, Date)

I have connected c# windows app with MySQL like below:

<connectionStrings>
    <add name="CC" connectionString="datasource=127.0.0.1; port=3306;username=root;password=123;database=sensordb"/>
</connectionStrings>
Posted
Updated 20-Jan-21 1:30am
Comments
Richard MacCutchan 20-Dec-20 10:25am    
Without knowing anything about the server application, the protocol it uses, or the format of the data it presents, it is impossible to offer suggestions.
DerekT-P 2-Jan-21 6:36am    
You say it's a remote server - but your connection string is explicitly stating the d/b is on the local machine (127.0.0.1). If you're using the MySql .Net connector, your connstring syntax is also incorrect - it should be something like connectionString="Server=remoteserveraddress;Database=sensordb;Port=3306;UID=root;PWD=123" (I suggest you setup a non-root user on the server, and use that for this application too). But as a first step, use a d/b tool like HeidiSQL or MySqlWorkbench to check you can connect successfully to your server. It's much easier that way and confirms any error is not in your code. Once you've confirmed that you've got the connection details right, you'll be able to move forward more confidently.

Just use the connection server address and insert correct remote server address.

connectionString="server=<remote server ip>;User Id=root;password=bpdash;database=sample"
 
Share this answer
 
<connectionStrings>
    <add name="CC" connectionString="Data source=127.0.0.1; initial Catalog=sensordb"; port=3306;User Id=root; password=123 providerName="System.Data.SqlClient" />
</connectionStrings>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900