提問者
Connection String from MYSQL Workbench

問題
-
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
- 已編輯 SharePoint User02 2020年8月14日 上午 05:36
2020年8月14日 上午 05:35
所有回覆
-
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
- 已編輯 SharePoint User02 2020年8月14日 上午 06:05
2020年8月14日 上午 06:04 -
new MySql.Data.MySqlClient
This is a forum for Microsoft SQL Server, not for MySQL => => https://forums.mysql.com/
Olaf Helper
[ Blog] [ Xing] [ MVP]- 已提議為解答 Cathy JiMicrosoft contingent staff 2020年8月17日 上午 07:40
2020年8月14日 上午 06:17 -
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.- 已提議為解答 Cathy JiMicrosoft contingent staff 2020年8月18日 上午 08:10
2020年8月17日 上午 07:40 -
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.2020年8月18日 上午 08:10