日期:2014-05-18 浏览次数:20894 次
string a="Table_"; string sql = "SELECT 列名 FROM @A WHERE 查询条件"; cmd = new SqlCommand(sql, conn); a = a + "1"; cmd.Parameters.AddWithValue("@A", a);
string a="Table_"; a = a + "1"; string sql = string.Format("SELECT 列名 FROM {0} WHERE 查询条件",a); cmd = new SqlCommand(sql, conn);