using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.UI.Page;
namespace practice1
{
public partial class WebForm1 : System.Web.UI.Page
{
private void page_load(object sender, System.EventArgs e)
{
SqlConnection myconnection = new SqlConnection("sever=localhost;uid=sa;pwd=sa");
try
{
myconnection.Open();
Response.Write("数据导入成功!");
}
catch
{
Response.Write("数据导入失败!");
}
}
override protected void OnInit(System.EventArgs e)
{
InitiallizeComponent();
base.OnInit(e);
}
private void InitiallizeComponent()
{
this.Load = new System.EventHandler(this.page_load);
}
}
}
相关分类