Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compiling for 'AnyCPU' through errors
Message
From
04/04/2011 17:00:00
 
 
To
04/04/2011 16:14:01
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01506035
Message ID:
01506048
Views:
55
Hi Bonnie

This is certainly a posibility. I didn't know it was possible. What specificly would i be looking for? I know the 64bit machine has .NET4 installed amongst the others like 3.5 etc.

Also i am tranlating the code into (i hope) pure sql (i wasn't aware that my original solution used LINQ. Here is what i am doing with it
Dim sql_Table As New DataTable
sql_Table = Me.ClientsTableAdapter.GetClient("P" & Me.ClientID.Text)
Me.ClientFirst.Text = Functions.PCase(sql_Table(0)("Name_First"))
Me.ClientLast.Text = Functions.PCase(sql_Table(0)("Name_Last"))
converts to
Dim myConnection As SqlConnection = Me.ClientsTableAdapter.Connection
myConnection.Open()
Dim sqlCmd As String = ""
sqlCmd += "SELECT Patient_Code, Name_First, Name_Last FROM Clients WHERE "
sqlCmd += " Patient_Code = 'P" + Me.ClientID.Text + "'"
Dim myCommand As SqlCommand = New SqlCommand(sqlCmd, myConnection)
Dim myReader As SqlDataReader = myCommand.ExecuteReader
myReader.Read()
Me.ClientFirst.Text = Functions.PCase(myReader("Name_First"))
Me.ClientLast.Text = Functions.PCase(myReader("Name_Last"))
myReader.Close()
myConnection.Close()
It seems to be a whole lot more code - I hope there is no performance disadvantage.



>Hi Gunnar,
>
>I've always compiled with "AnyCPU", and I'm not sure why your compile would generate any errors (although, I have NOT used LINQ-to-SQL, which sounds like what you're doing ... not sure if that matters). Are you sure that your orginal problem (with running the app, not the subsequent recompiles) wasn't caused by not having the correct .NET Framework version on the XP 64-bit machine?
>
>~~Bonnie
>
>
>
>
>>Hello Everybody.
>>
>>Ok - so I completed my first .NET app (desktop in vb.net and a asp.net web portion), compiled it in x86, install it on WindowsXP (32bit) and Windows 7 (64bit) machines, and it works great. - Hurray :-)
>>
>>Now i have some Windows XP 64 bit machines where i got an error right when I am starting the app (the desktop program). I think there was some mentioning about the System.Windows.Forms namespace.
>>
>>Well, so I am thinking to myself: "sure that makes sence, just recompile as "AnyCPU".
>>
>>Oops - maybe not. First i got some complaints about LINQ - so i converted that code to the System.Data.SqlClient stuff. Still everything works great on the other machienes (reinstalled).
>>
>>But now i get an error when compiling (not the code sections I converted) as follows (about 72 errors):
>>Dim MasterTypeRow As DataTable = _
>>   Me.TableAdapterManager1.DocumentTypesTableAdapter.GetType_Level0( _ 
>>      Me.DocList(nRow, 3), Me.DocList(nRow, 4), Me.DocList(nRow, 5))
>>
>>' this following line triggers the error
>>Dim MasterType As String = MasterTypeRow(0)("Type_level0")
>>throughs the error:
>>'ElementAtOrDefault' is not a member of 'System.Data.EnumerableRowCollection(Of System.Data.DataRow)'.
>>Does anybody have an idea what i am missing here?
>>
>>Thank you for all your help!
Previous
Reply
Map
View

Click here to load this message in the networking platform