列名称中的空格 [英] Spaces in column name

查看:75
本文介绍了列名称中的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当触发此事件时,出现以下异常

错误:

''System.Data.SyntaxErrorException''

缺少后的操作数''''''''运营商。


所以大概它不喜欢列中的空格

名称,有没有办法暂时重命名列

这个程序,还是我必须重命名数据库中的列

,重新生成数据集并重新绑定网格?

\ \\

Dim strThisWeeksOrders As String = Today.ToOADate - 7

Me.OrdersDataGrid.DataSource = DataView1

DataView1 .RowFilter ="订单日期= strThisWeeksOrders"

///


提前致谢


问候史蒂夫

When this event is triggered the following exception
error occurs:
''System.Data.SyntaxErrorException''
Missing operand after ''of'' operator.

So presumably it doesn''t like the spaces in the column
name, is there any way of temporarily renaming the column
for this procedure, or will I have to rename the column
in the database, regenerate datasets and rebind the grid ?
\\\
Dim strThisWeeksOrders As String = Today.ToOADate - 7

Me.OrdersDataGrid.DataSource = DataView1
DataView1.RowFilter = "Date of Order = strThisWeeksOrders"
///

Thanks in advance

Regards Steve

推荐答案

" Steven Smith" <一个******* @ discussions.microsoft.com> schrieb
"Steven Smith" <an*******@discussions.microsoft.com> schrieb
当触发此事件时,会发生以下异常
错误:
''System.Data.SyntaxErrorException''
''''运算符后缺少操作数。

所以大概它不喜欢列中的空格
名称,有没有办法暂时重命名这个程序的栏目,或者我是否需要重命名数据库中的列
,重新生成数据集并重新绑定网格?

\\\
Dim strThisWeeksOrders As String = Today.ToOADate - 7


你应该启用Option Strict。

Me.OrdersDataGrid.DataSource = DataView1
DataView1.RowFilter ="订单日期= strThisWeeksOrders"
/ //

提前致谢

关心Steve
When this event is triggered the following exception
error occurs:
''System.Data.SyntaxErrorException''
Missing operand after ''of'' operator.

So presumably it doesn''t like the spaces in the column
name, is there any way of temporarily renaming the column
for this procedure, or will I have to rename the column
in the database, regenerate datasets and rebind the grid ?
\\\
Dim strThisWeeksOrders As String = Today.ToOADate - 7
You should enable Option Strict.
Me.OrdersDataGrid.DataSource = DataView1
DataView1.RowFilter = "Date of Order = strThisWeeksOrders"
///

Thanks in advance

Regards Steve




未经测试:

DataView1 .RowFilter =" [订购日期] =" &安培; strThisWeeksOrders

你为什么声明订单日期?双倍?


-

Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


嗨史蒂文,


订单的日期必须是一个数据表达式,这个我无法找到.b / b <


是不是只有一个日期列,而不是


" MyOrderDate = strWeekorders"还不够吗?


Cor
Hi Steven,

That date of Order has to be an datacolumn expression this one I could not
find.

Is there not a just a date column in order and is than

"MyOrderDate = strWeekorders" than not sufficient?

Cor
当触发此事件时,会发生以下异常
错误:
'' System.Data.SyntaxErrorException''
'''''''''''''''''''''''''''











任何临时重命名列的方法
这个程序,还是我必须重命名数据库中的列
,重新生成数据集并重新绑定网格?

\\ \
Dim strThisWeeksOrders As String = Today.ToOADate - 7

Me.OrdersDataGrid.DataSource = DataView1
DataView1.RowFilter ="订单日期= strThisWeeksOrders"
///

提前致谢

关心Steve
When this event is triggered the following exception
error occurs:
''System.Data.SyntaxErrorException''
Missing operand after ''of'' operator.

So presumably it doesn''t like the spaces in the column
name, is there any way of temporarily renaming the column
for this procedure, or will I have to rename the column
in the database, regenerate datasets and rebind the grid ?
\\\
Dim strThisWeeksOrders As String = Today.ToOADate - 7

Me.OrdersDataGrid.DataSource = DataView1
DataView1.RowFilter = "Date of Order = strThisWeeksOrders"
///

Thanks in advance

Regards Steve



否否否我看过Armins回答
No No No I saw Armins answer
" MyOrderDate = strWeekorders"还不够吗?
" MyOrderDate =" &安培; strWeekorders还不够吗?


抱歉看起来不太好


Cor
订单日期必须是数据表达式一个我无法找到。

是不是只有一个日期列,而不是

MyOrderDate = strWeekorders还不够吗?

"MyOrderDate = strWeekorders" than not sufficient? "MyOrderDate = " & strWeekorders than not sufficient?

Sorry did not look well

Cor
That date of Order has to be an datacolumn expression this one I could not
find.

Is there not a just a date column in order and is than

"MyOrderDate = strWeekorders" than not sufficient?

Cor
当触发此事件时,会发生以下异常
错误:
''System.Data。 SyntaxErrorException''
在'''''''''''''''''''''''''''''






为此过程重命名列
,或者我是否必须重命名数据库中的列
,重新生成数据集并重新绑定网格?

\\\
Dim strThisWeeksOrders As String = Today.ToOADate - 7

Me.OrdersDataGrid.DataSource = DataView1
DataView1.RowFilter ="订单日期= strThisWeeksOrders"
///

提前致谢

关心Steve
When this event is triggered the following exception
error occurs:
''System.Data.SyntaxErrorException''
Missing operand after ''of'' operator.

So presumably it doesn''t like the spaces in the column
name, is there any way of temporarily renaming the column
for this procedure, or will I have to rename the column
in the database, regenerate datasets and rebind the grid ?
\\\
Dim strThisWeeksOrders As String = Today.ToOADate - 7

Me.OrdersDataGrid.DataSource = DataView1
DataView1.RowFilter = "Date of Order = strThisWeeksOrders"
///

Thanks in advance

Regards Steve




这篇关于列名称中的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆