namespace UpdateMaster
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SqlConnection conn = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=master;User Id=sa;Password=123456");
private void button1_Click(object sender, EventArgs e)
{
string SqlQuery = string.Format("UPDATE EXEC sp_addlinkedserver 'GHBILL','','MSDASQL',NULL,NULL,'DRIVER={SQL Server};SERVER=localhost;UID=;PWD=;'", conn);
SqlDataAdapter Adpter = new SqlDataAdapter(SqlQuery, conn);
Adpter.SelectCommand.ExecuteNonQuery();
conn.Close();
MessageBox.Show("Update SuccessFully!!!");
}
}
}
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SqlConnection conn = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=master;User Id=sa;Password=123456");
private void button1_Click(object sender, EventArgs e)
{
string SqlQuery = string.Format("UPDATE EXEC sp_addlinkedserver 'GHBILL','','MSDASQL',NULL,NULL,'DRIVER={SQL Server};SERVER=localhost;UID=;PWD=;'", conn);
SqlDataAdapter Adpter = new SqlDataAdapter(SqlQuery, conn);
Adpter.SelectCommand.ExecuteNonQuery();
conn.Close();
MessageBox.Show("Update SuccessFully!!!");
}
}
}