[在线等]如何在Sql语句中使用字符串表名称 string TableName = xxxxxxx;string sql = "select * from " + TableName + " where ..............."; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你使用如下的方法看看,是否能够满足您的要求:declare @Table varchar(20)declare @Sql varchar(100)select @Table='sysobjects'select @Sql='select * from ' +@Tableexec(@Sql)此例子使用的是字符表名称。 string table="table1";string sql="select * from "+table; string m_table = "users";string sql = "select * from " + m_table + " where id>0 "; string TableName = "test";string sql = "select * from " + TableName + " where ..."; 请问,这个正则表达式如何写 如何通过Marshal.GetFunctionPointerForDelegate获取函数指针? 哪位大侠帮我看下,姐姐感激不尽! 内存释放,读了10万行记录,现在关闭窗体后内存依旧占用。 C#中怎么调用SetSystemTime,我每次返回都是0(失败),附代码,大家帮忙,急! C#学习心得 重写控件的鼠标响应后ContextMenu无法显示的问题 datagrid数据更新的问题 如何用c#做出类似于.net中的属性控件 SQL SERVER 与 Datatable 的问题 关于DataGrid和DataSet结合的假象 绘图难题
declare @Table varchar(20)
declare @Sql varchar(100)
select @Table='sysobjects'
select @Sql='select * from ' +@Table
exec(@Sql)
此例子使用的是字符表名称。
string sql="select * from "+table;
string sql = "select * from " + m_table + " where id>0 ";
string sql = "select * from " + TableName + " where ...";