我在vs2010中创建了一个Windows服务,并且还创建了两个installer.one用于64位计算机,一个用于32位计算机。它在开发环境中工作正常。但是当我在64位虚拟机上安装时,它将会给我带来问题。当我在32位虚拟机上安装时,它运行正常。 即使我尝试64位物理机,这里也工作正常。 我收到了像
这样的错误System.NullReferenceException: Object reference not set to an instance of an object.
at IIVantagesrv.IIV_commonfunctions.ExecQueryCmd(DataSet ds, String Table, String CmdString)select 9 as cnt,
isnull(pth_ptdob,'') as pth_ptdob, isnull(barcode1,'') as barcode1, isnull(specimen,'') as specimen, isnull(line2,'') as line2,
isnull(orderlist,'') as orderlist, isnull(pth_alpha,'') as mnumber,
isnull(pthspec_tissuetype, '') as tissuetype
from iiv_holdforlabel_iivlabel
inner join iiv_path on specimen = pth_spec
inner join iiv_pathspectype on pth_key = pthspec_key and pthspec_ordernumber = orderlist"
我创建了" mstr_ds"作为数据集和"重印"是一个数据表。在那里"重印是数据名称"
If mstr_ds.Tables("reprint") Is Nothing = False Then
mstr_ds.Tables.Remove("reprint")
End If
Dim str1 As String = "select 9 as cnt, isnull(pth_ptdob,'') as pth_ptdob, isnull(barcode1,'') as barcode1, isnull(specimen,'') as specimen, isnull(line2,'') as line2, isnull(orderlist,'') as orderlist, isnull(pth_alpha,'') as mnumber, isnull(pthspec_tissuetype, '') as tissuetype from iiv_holdforlabel_iivlabel inner join iiv_path on specimen = pth_spec inner join iiv_pathspectype on pth_key = pthspec_key and pthspec_ordernumber = orderlist"
ExecQueryCmd(mstr_ds, "reprint", str1)
If mstr_ds.Tables("reprint") Is System.DBNull.Value = False AndAlso mstr_ds.Tables("reprint") Is Nothing = False AndAlso mstr_ds.Tables("reprint").Rows.Count > 0 AndAlso mstr_ds.Tables("reprint").Columns.Count > 3 Then
'这里有一些代码
还有一个错误
System.ArgumentException: Column 'expr1' does not belong to table hl7spec_cnt.
at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.get_Item(String columnName)
at IIVantagesrv.IIV_HL7toVantage.sendtoHL7(String[] specarray, Int32 specarraylength, String hpath)
即使列' expr1'存在于数据表中它仍然给出错误。 在这里,我发现一个有趣的事情是它在Windows Server 2008上无法正常工作。它在Windows 7中工作正常。 任何人请帮帮我。我得到的大多数问题都与连接有关。 "不允许更改' ConnectionString'属性。连接的当前状态是连接。" 还有一个是:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Invalid attempt to call MetaData when reader is closed.
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlDataReader.GetFieldType(Int32 i)
at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetFieldType(Int32 ordinal)
at System.Data.ProviderBase.SchemaMapping.SetupSchemaWithoutKeyInfo(MissingMappingAction mappingAction, MissingSchemaAction schemaAction, Boolean gettingData, DataColumn parentChapterColumn, Object chapterValue)
at System.Data.ProviderBase.SchemaMapping..ctor(DataAdapter adapter, DataSet dataset, DataTable datatable, DataReaderContainer dataReader, Boolean keyInfo, SchemaType schemaType, String sourceTableName, Boolean gettingData, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.FillMappingInternal(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.FillMapping(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at IIVantagesrv.IIV_commonfunctions.FillDataSetFromReader(DataSet ds, String table, IDataReader dr)
at IIVantagesrv.IIV_commonfunctions.ExecQueryCmd(DataSet ds, String Table, String CmdString)select 'sent' as expr1 from iiv_SentHL7 where senthl7_speckey = 2