try
{
SqlConnection con = new SqlConnection("server=it003;database=pubs;uid=sa;pwd=");
con.Open();
string sql ="CREATE TABLE "+TextBox1.Text.Trim()+" (id INTEGER PRIMARY KEY,title CHAR(50),answer CHAR(255),kemuid CHAR(255),collegeid CHAR(20),time CHAR(20))";
SqlCommand com= new SqlCommand(sql,con);
com.ExecuteNonQuery();
con.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString());
}
{
SqlConnection con = new SqlConnection("server=it003;database=pubs;uid=sa;pwd=");
con.Open();
string sql ="CREATE TABLE "+TextBox1.Text.Trim()+" (id INTEGER PRIMARY KEY,title CHAR(50),answer CHAR(255),kemuid CHAR(255),collegeid CHAR(20),time CHAR(20))";
SqlCommand com= new SqlCommand(sql,con);
com.ExecuteNonQuery();
con.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString());
}

浙公网安备 33010602011771号