Coming up against a brick wall with sending items over the network using sockets. I'm using Chilkat rather than the built in TCP Client / listener but thats not the issue. From point a I send through a string converted to base64 as below
I will be storing an array in session that will contain data entered by the user (id numbers used to search in several different areas of the application) I then want to return the values in this array that is residing in session as auto complete selections.
Getting the array into session and updating it is the easy part, getting it from session into the autocomplete isn't as much so. I'd rather use the array to do the auto complete instead of converting to json.
I've tried using '<%= SESSION("MEMBER_SEARCH_ARRAY") %>' as the source for the autocomplete but no dice.
I have been trying to use a bit array as a dictionary key and even though I know each bitarray value is different the program fails with a duplicate key message when a try to add the second record to the dictionary. Is there any way I can make this work?
Dim AttributeValuePairs() As Dictionary(Of String, String) = New Dictionary(Of String, String) byt this i mean AttributeValuePairs is a Array of dictionaries
I am trying to deserialize a JSON string that looks like so: {'type':'clientlist','client_list':[]} I am using JavaScriptSerializer() to do it. For some reason the JavaScriptSerializer() is choking on the member 'client_list'. It doesn't give very good info. The error it gives is:
Error Message: "This server version is not supported. Only servers up to Microsoft SQL 2005 are supported VB.NET" I am using VB.NET 2008 and attempting to connect to SQL Server 2008 with XP as the operating system. I have service pack 1 installed in Visual Studio but this error message presists. The articles I have read on this error said to install sp1 as a solution but I have done that and the error persists. FYI, the error does not occur when I am using code to connect to SQL Server but when I attempt to connect using one of the designer wizards this error occure.
I want to group items from a linq query under a header, so that for each header I have a list of objects that match the header title. I assumed the solution would be to use ToDictionary to convert the objects, but this allows only one object per "group" (or dictionary key). I assumed I could create the dictionary of type (String, List Of()), but I can't figure out how to write it. As an example I have written a simplified version below.
I have created a class with a function in it. I have a collection of data I want to pass back. I tried an arraylist first. Now I am trying to use a dictionary. My problem is that it creates the dictionary ok, but I am only get the last row of data from my
Function GetWeldAuditInfo(ByVal ResourceId As String, ByVal VendorId
countDictionary As Dictionary(of Category, Dictionary(of Date, Integer))
The Class has a Enumeration Property. For the purposes of demonstration, I'll call it MasterCategory.I have been trying to get out an object that looks like the following:
groupedCountDictionary As Dictionary(of MasterCategory, Dictionary(of Date, Integer)
Which results in a IEnumerable (Of Dictionary(of Date, Integer)) for each MasterCategory value.However, I need that IEnumerable of Dictionary flattened to one dictionary with all the integers summed (total counts) for each date. I then tried to use various selects and group bys (from numerous stackoverflow posts) to "flatten" it, but my efforts have fallen short.
Current Code
[Category Class] - MasterCategory As Enum - Name As String etc
Some code first..this is how i deserialize..This part works.
Dim rdr As XmlReader = XmlReader.Create(New System.IO.StringReader(Replace(prestr, "><", ">" & vbCrLf & "<"))) Dim serialize As XmlSerializer = New XmlSerializer(GetType(ItemLookupResponse)) Dim myProduct As ItemLookupResponse = New ItemLookupResponse myProduct = CType(serialize.Deserialize(rdr), ItemLookupResponse)
I have a Child class which uses DataContractSerialization and raises a Changed event when its Name property is set.
<DataContract()> Public Class Child Public Event Changed()
The Parent class is serialzed and deserialized and all the data (including the Child) is saved and resored as expected.However, after deserialization, the Changed event is never raised!I know the deserialization process bypasses class constructors, but shouldn't the event be initialized?Is it possible to serialize/deserialize the Event?Is there a way to initialize the event in the OnDeserialzed method of the Child rather than the Parent (see below)?
(1) Add a constructor to the Child class which takes an instance of itself as an argument.
(2) Add an OnDeserialized method to the Parent class which creates a New instance of the Child class based on the deserialzed instance of the Child class.
<OnDeserialized()> Private Sub OnDeserializedMethod(ByVal Context As StreamingContext) Child = New Child(Child) End Sub
I would like to handle the progress of binary serialization / deserialization of files to show a "loading" progress bar to the user but I cant't find a solution to do that.
I am not seeing what I am doing wrong. To see what was being done, I changed the constructor values to "TEST", after the XML gets read in (I verified what the XML is), the class values are still stuck to "TEST". Any more Ideas? I am doing this process already in another class that works fine, neither me nor some co-workers could find the difference.[code]...
I have created a Dictionary class (MyDictionary for the example). I am currently trying to pass MyDictionary into a function, filter it into a new instance of MyDictionary and pass this new instance into another method. When I am attempting to create the second instance from the filtered first instance of MyDictionary via Lambda Expressions and the ToDictionary Method, I am getting the following error:
Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.Int32,System.String]' to type 'MyDictionary'. I have simplified the example and recreated it in LINQPad and am getting the same error.
I use VS2005 and I have just started working with the dictionary in particular the Dictionary.ContainsKey method. At the bottom of the page in the msdn library it says the following in the community content How to make sure that Contains functions properly.
I am having problems deserializing the response message I receive from the proxy class I created through WSDL.exe. I believe the problem lies in the fact that I am using XmlArrayItem, which has nested items within.Instead of getting:
Can somebody post a GOOD and short example of serialization and deserialization of an object?Where it can produce an output to string and later be crypted for database purpose. ^.^
I am trying a simple object deserialization from an object encoded as a Base64 string, but I keep getting this weird error message. I've searched the forums for a solution but those who've experienced this all had different reasons for the error. The most logical solution, which is resetting the stream's position, did not work either. Here's my code:
Dim UnserializedObject As Object Dim ser As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter Dim buffer As Byte()
To object oriented programming and programming with visual basic .net (vb 2008 express). regarding storing of information but not in a database. Someone mentioned using binary or xml serialization. So I researched that and after two long 8 hour days of messing around with binary serialization and about a dozen different code techniques i finally found one that seems to work. I created a module that serializes two variables and appends them into a file. The same module also has a sub that deserializes the information from the file and displays in a message box. If needed I'll provide the code later.
Really the problem I am having is that my message box only displays the first entry into the file and no other. So I can append any number of variables to the file but every time I call the subroutine in my module it only displays the first entry. How do you read all of the file? Also can I search the file for a particular value of a variable? The variables are codependent. The two variables are simply a date and a string representing a changing code that corresponds to that specific date. So I'd like to be able to say search for a date and retrieve both the date and the code.
However I don't have any idea how to do this. Also the messagebox.show method is probably not the best way to illustrate the information in the file but I'm still new and I'm not sure the best way to show all the info in the file. For instance if I wanted to show the entire contents or just the codes corresponding to certain dates. I know a database is probably the better answer but I've gotten this far without one, lol, I'm too stubborn to change now. Once I figure this out, I'll switch and try the same technique with a database.
Is the MetaWeblog API still supported? I ask because while researching XMLRPC, the Cook Computing library and implementing MetaWeblog API, I clicked a link that took me to MSDN that states the topic has been removed.There is a link there that takes me to new docs for Windows Live SDK. On the new page i cannot find current info on MWAPI. I am using EF, MV3, and VB.Net.
I was using WMI msacpi_thermalzonetemperature class to read the CPU temperature. but Its giving me Not Supported error.I think this error is coming because of some driver missing on motherboard. I amnot that good in hardware.which driver i need to download on my Window7 ACPI x64-based PC.