如何把这句SQL转换成string语句,谢谢!
SELECT ACTIVITY.ACTIVITYID AS ""kkk"",ACTIVITY.ORGID AS ""bbbb""" & Chr(13) & "" & Chr(10) & "FROM DB2ADMIN.ACTIVITY ACTIVITY如题,此SQL虽然奇怪,但是是从Excel中的宏录制出来的
--------------------编程问答--------------------
string sql = @"SELECT ACTIVITY.ACTIVITYID AS """"kkk"""",ACTIVITY.ORGID AS """"bbbb"""""" & Chr(13) & """" & Chr(10) & ""FROM DB2ADMIN.ACTIVITY ACTIVITY";--------------------编程问答-------------------- 但是从语句的意义来看,似乎应该是:
string sql = @"SELECT ACTIVITY.ACTIVITYID AS ""kkk"",ACTIVITY.ORGID AS ""bbbb""--------------------编程问答-------------------- 我猜原文可能是VB的字符串:
FROM DB2ADMIN.ACTIVITY ACTIVITY";
"SELECT ACTIVITY.ACTIVITYID AS ""kkk"",ACTIVITY.ORGID AS ""bbbb""" & Chr(13) & "" & Chr(10) & "FROM DB2ADMIN.ACTIVITY ACTIVITY"--------------------编程问答--------------------
SELECT ACTIVITY.ACTIVITYID AS ""kkk"",ACTIVITY.ORGID AS ""bbbb""" & Chr(13) & "" & Chr(10) & "FROM DB2ADMIN.ACTIVITY ACTIVITY--------------------编程问答-------------------- lz分太多了吧?
string sql = "SELECT ACTIVITY.ACTIVITYID AS kkk,ACTIVITY.ORGID AS bbbb FROM DB2ADMIN.ACTIVITY ACTIVITY ";
SQL中,引号是用来限定包含特殊字符的标识符的,你的SQL中可以去掉,回车换行也可以去掉,结果都是一样的 --------------------编程问答-------------------- string sql = @"SELECT ACTIVITY.ACTIVITYID AS ""kkk"",ACTIVITY.ORGID AS ""bbbb""
FROM DB2ADMIN.ACTIVITY ACTIVITY";
补充:.NET技术 , C#