SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
//string sql = "Create Table testtable(test1 varchar not null primary key,test2 int)";
string sql = "alter table test add test5 int default (0)";
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Connection.Open();
try
{
cmd.ExecuteNonQuery();
}
catch
{
//MessageBox.Show(ex.Message);
}
finally
{
cmd.Connection.Close();
}
//string sql = "Create Table testtable(test1 varchar not null primary key,test2 int)";
string sql = "alter table test add test5 int default (0)";
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Connection.Open();
try
{
cmd.ExecuteNonQuery();
}
catch
{
//MessageBox.Show(ex.Message);
}
finally
{
cmd.Connection.Close();
}
浙公网安备 33010602011771号