HOW TO: Create a SQL Server Database Programmatically by Using ADO.NET and Visual C# .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q307283then connect to the database, use syntax like the following to create a table:using System.Data.SqlClient;SqlConnection myConn = new SqlConnection ("Server=localhost;Integrated security=SSPI;database=YourDBName");String sQL = "CREATE TABLE YourTableName ...";SqlCommand myCommand = new SqlCommand(sSQL, myConn);myConn.Open();
myCommand.ExecuteNonQuery();
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q307283then connect to the database, use syntax like the following to create a table:using System.Data.SqlClient;SqlConnection myConn = new SqlConnection ("Server=localhost;Integrated security=SSPI;database=YourDBName");String sQL = "CREATE TABLE YourTableName ...";SqlCommand myCommand = new SqlCommand(sSQL, myConn);myConn.Open();
myCommand.ExecuteNonQuery();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货