Asked by:
Connection String from MYSQL Workbench

Question
-
I want to save data from SQL to SharePoint List.
But I am stuck in making connection string .Coz after making i have to save that data into sharepoint list daily
Please Suggest
Shiv Sharma
- Edited by SharePoint User02 Friday, August 14, 2020 5:36 AM
Friday, August 14, 2020 5:35 AM
All replies
-
Connection string has been done using below code, Now please help me out to save data from SQL to SharePoint List:
public static String GetDatafromSQL()
{
string serverIp = "172.30.71.80";
string username = "SP1234";
string password = "SP@1234";
string databaseName = "userInfo1";
string PortNumber = "3306";
string dbConnectionString = string.Format("server={0};uid={1};pwd={2};database={3};port={4};", serverIp, username, password, databaseName, PortNumber);
string query = "SELECT * FROM user";
var conn = new MySql.Data.MySqlClient.MySqlConnection(dbConnectionString);
conn.Open();
var cmd = new MySql.Data.MySqlClient.MySqlCommand(query, conn);
var reader = cmd.ExecuteReader();
while (reader.Read())
{
var someValue = reader["contact"];
// Do something with someValue
}
string Status = "Yes";
return Status;
}
Shiv Sharma
- Edited by SharePoint User02 Friday, August 14, 2020 6:05 AM
Friday, August 14, 2020 6:04 AM -
new MySql.Data.MySqlClient
This is a forum for Microsoft SQL Server, not for MySQL => => https://forums.mysql.com/
Olaf Helper
[ Blog] [ Xing] [ MVP]- Proposed as answer by Cathy JiMicrosoft contingent staff Monday, August 17, 2020 7:40 AM
Friday, August 14, 2020 6:17 AM -
Hi SharePoint User02,
As Olaf mentioned, this is MS SQL server forum that talking about MS SQL server issues, suggest you post your issue on MySQL forum.
By the way, If the replies could help you, please kindly mark the useful reply as answer. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.
Best regards,
Cathy""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
For more information, please refer to the sticky post.- Proposed as answer by Cathy JiMicrosoft contingent staff Tuesday, August 18, 2020 8:10 AM
Monday, August 17, 2020 7:40 AM -
Hi SharePoint User02,
Any update? Did you post your issue in the corresponding forum ,in order to close this thread, please kindly mark helpful replies as answers. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.
Best regards,
Cathy""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
For more information, please refer to the sticky post.Tuesday, August 18, 2020 8:10 AM