错误提示Invalid column name tcc2
表 tcc2怎么变成列column了呢?
直接drop table tcc2 就可以
name tcc[i]提示Incorrect syntax near 'i'.
name tcc"+i.ToString()+"也不行 for (int i = 2; i <= 12; i++)
{
string yu7 = "select count(*) from sysobjects where name = tcc"+i.ToString()+" and type = 'U' ";
SqlCommand gh7 = new SqlCommand(yu7, con); if ((int)gh7.ExecuteScalar() >= 1)
{
SqlCommand tb7 = new SqlCommand("drop table tcc"+i.ToString()+"", con);
tb7.ExecuteNonQuery();
}
}
解决方案 »
- 上位机用USB与下位机通信,能用C#写上位机程序吗
- 求助已有打开的与此命令相关联的 DataReader,必须首先将它关闭。
- 在哪儿下载完整的dotnetfx35.exe安装包,因为每次安装时总让我联网下载文件。请前辈指点!
- C#把结构体清0
- Runtime的问题
- 关于reportviewer中动态控制文本框的问题
- 帮帮小弟吧!!!这是我所有的 家当 了!!关于跨窗体托动的问题。
- .net中怎样用代码实现执行"ctrl+c"
- 如何用代码实现对文件夹权限的控制(添加用户,并完全访问)
- 删除文件问题?无法删除,但程序不报错!!!
- 怎样把数据绑定到ToolStripComboBox的ComboBox里?
- Winform中如何将自定义的对象放到DataTable中
name = tcc"+i.ToString()+" 就不行
name = 'tcc'+'"+i.ToString()+"'就行了。还是要靠自己。
如果是oracle表示一个字符串必须为单引号
但如果是SQL的话,单引号和双引号都没有什么区别的。