双击就可以添加SqlConnection了,控件必须要另行添加(原来的ToolBox)里面没有,然后: InitializeComponent();
SqlConnection myConnection = new SqlConnection("server=[yourserver];database=[yourdata];user id=[your id];password=[youpassword]");
DataSet ds = new DataSet();
SqlDataAdapter myCommand = new SqlDataAdapter("SQL QUERY", myConnection);
myCommand.Fill(ds);
return ds;
--------------------------------
就可以了
双击就可以添加SqlConnection了,控件必须要另行添加(原来的ToolBox)里面没有,然后:
InitializeComponent;
SqlConnection myConnection=新的 SqlConnection;("server=; database=; 使用者遗传素质 =[ 你的遗传素质 ]; password=")
数据组 ds=新的数据组;()
SqlDataAdapter myCommand=新的 SqlDataAdapter;("SQL 疑问",myConnection)
myCommand.Fill;(ds)
回行的 ds;