{
string str = String.Format("你的SQL语句");
insert_ips(str);
}
class Conn
{
public static string GetConnection()
{
return "Data Source=10.10.0.28; initial Catalog=ipmaster;User ID=sa;Password=xxxx";
}
public static int insert_ips(string str)
{
string res;
SqlConnection con = new SqlConnection(GetConnection());
con.Open();
SqlCommand cmd = new SqlCommand(str, con);
res = cmd.ExecuteNonQuery();
return res;
}
}