所有用SQL 语句sel ect * from 生成的table都报错。 下面的老代码已经部署了好久了,这次升级以后一直报错。 我的上版程序是 5.1日高级开发版
Dim cmd As New SQLCommand
cmd.ConnectionName=_ConnectionName
Dim PTB As Table=e.Form.Controls("SalesOD").Table
cmd.Comm andText = "SEL ECT * FROM {SalesInvs} where 1=0 "
ptb.datasource = cmd.ExecuteReader(True)
\'同步列标题
For Each cl As Col In ptb.Cols
cl.caption = DataTables("SalesInvs").DataCols(cl.name).caption
cl.TextAlign = Tables("SalesInvs").Cols(cl.name).TextAlign
Next
ptb .BuildHeader()
\' ptb.DataTable.DataCols("Weight").SetFormat("#,###.0")
ptb.Cols("TimeCreated").DataCol.SetDateTimeFormat(DateTimeFormatEnum.DateTime)
ptb.DataTable.AddUserStyle("locked", Color.fromargb(255,224,224,224), Color.black) \'标记锁定区域
ptb.DefaultRowHeight =35
ptb.SetHeaderRowHeight(22,22)
Dim cvs As String = "InvoiceDate|79|DueDate|79|ProjectNo|67|Address_Street|118|Address_Suburb|103|address_City|77|CustON|98|Notes|200|Confirmed|42|Printed|42|PaymentTerm|92|PriceLevel|73|SalesPerson|80"
ptb.SetColVisibleWidth(cvs)
ptb.AllowEdit = True
\' bind field for controls
Dim TBName As String = ptb.name
e.Form.Controls("BranchID").BindingField = TBName & "." & "BranchID"
e.Form.Controls("CustomerID").BindingField = TBName & "." & "CustomerID"
e.Form.Controls("CustomerName").BindingField = TBName & "." & "CustomerName"
e.Form.Controls("SalesON").BindingField = TBName & "." & "InvoiceNo"
e.Form.Controls("HideRates").BindingField = TBName & "." & "HideRatesForPrinting"
e.Form.Controls("TotExcGST").BindingField = TBName & "." & "TotExcGST"
e.Form.Controls("TotIncGST").BindingField = TBName & "." & "TotIncGST"
e.Form.Controls("GST").BindingField = TBName & "." & "GST"
e.Form.Controls("confirmed").BindingField = TBName & "." & "confirmed"
e.Form.Controls("Printed").BindingField = TBName & "." & "Printed"
e.Form.Controls("PostedGL").BindingField = TBName & "." & "PostedGL"
e.Form.Controls("Author").BindingField = TBName & "." & "CreatedBy"
e.Form.Controls("TimeCreated").BindingField = TBName & "." & "TimeCreated"
e.Form.Controls("DatePaid").BindingField = TBName & "." & "PaymentDate"
e.Form.Controls("AmtOutstanding").BindingField = TBName & "." & "Outstanding"
\'**************************************************************
\'设置下拉输入框
ptb.Cols("DueDate").DropForm ="DateEntry"
ptb.Cols("InvoiceDate").DropForm ="DateEntry"
ptb.Cols("Address_Suburb").DropForm ="SuburbEntry"
ptb.Cols("Address_street").DropForm ="StreetEntry"
ptb.Cols("ProjectNo").DropForm ="ProjectEntry"
e.Form.Controls("SalesOD").visible = True