I am working on a method that generates another class using the CodeDom, VBCodeProvider, and whatever other classes are necessary. I will be using the method in a Windows Phone 7 (and possibly at some point Windows Phone 8) app, so my first question is, "Are all the necessary classes available...
I am trying to write an Extension Method for IEnumerable(Of T). I will be using reflection on the Type T in the Extension Method to get a list of it's properties so that I can create an Anonymous Type that will include all those properties. I have written Extension Methods before, but never a...
My basic situation is that, in an ASP.NET/VB.NET project of mine, I have several controls defined in *.vb files by inheriting from System.Web.UI.Control. These classes must obviously be built before any pages that use the controls, otherwise I would be trying to use controls that don't exist...
I have several classes in my solution that depend on each other, so the classes need to be built in a certain order for the solution to work. How can I force one class to be built before it tries to build another? Thanks.
The thing that had changed since my previous thread was that I modified the serialization code to not include any namespaces, so it now looks like the following:
Dim stream As New MemoryStream()
Dim ns As New XmlSerializerNamespaces() : ns.Add("", "")
Dim xml As New...
I have a class instance that I want to serialize, upload to SkyDrive, download from SkyDrive, and then deserialize. I have the serialization, uploading, and downloading working fine, but the deserialization gives me the following error:
There is an error in XML document (2, 2).
The generated...
On what line should I close the file? I have used Notepad to view the contents, they are exactly what I wanted and expected (well, that's what they look like in Notepad). It is all valid XML, no spaces at the beginning or end (at least none that I can see in Notepad), so the file contents seem...
I changed the code to:
Private Sub Client_DownloadCompleted(sender As Object, e As LiveDownloadCompletedEventArgs)
If e.Error Is Nothing Then
System.Diagnostics.Debug.WriteLine("Checkpoint 1")
Dim fs As New FileStream("GiftTrackerData.xml", FileMode.Create)
e.Result.CopyTo(fs)
Dim...
What should I do to save it to a FileStream? I couldn't seem to find a constructor or good method for creating a FileStream with the stream that I have. Thanks.
I tried reducing the download code to just:
Dim tempdata As SyncData = CType(New XmlSerializer(GetType(SyncData)).Deserialize(e.Result), SyncData)
But it still gives the same error:
There is an error in XML document (1, 1).
So you may be correct about what you said (although CanSeek was...
I don't know if this is the problem or not, but many of the things I managed to find online that mentioned this error said it had something to do with encoding. I do not specify a specific encoding anywhere in my code, so I am wondering if the fact that I use a MemoryStream while uploading is...
Actually, I do include that. Here is the rest of the code for creating the XML, it serializes the object and then uploads it:
Private Sub btnUpload_Tap(sender As Object, e As System.Windows.Input.GestureEventArgs) Handles btnUpload.Tap
If Me.client IsNot Nothing Then
AddHandler...
I have the following code that serializes an object:
Dim stream As New MemoryStream()
Dim xml As New XmlSerializer(GetType(SyncData))
xml.Serialize(stream, New SyncData(CType(Application.Current, App).Recipients, CType(Application.Current, App).Gifts))
However, when I later attempt to check...
I have a class that I need to serialize using XmlSerializer. The class is declared as follows:
<DataContract()> Public Class Recipient
<DataMember()> Public Property ID() As Byte
<DataMember()> Public Property Name() As String
<IgnoreDataMember()> Public ReadOnly Property Gifts() As Gift()...
Thanks, I think that worked when I used just the Parse method, I guess I was just having trouble finding anywhere that gave an example that used +0000, they all seemed to use +00:00 or some other format. Thanks again!
I have dates from a data file that I need to parse. Here is an example of one of the dates and what I have so far:
DateTime.ParseExact("2013-01-26T02:43:55+0000","yyyy-MM-dd\THH:mm:ss",
As you can see, the date includes the timezone offset (the "+0000" part at the end). I am not sure how to...
I found the problem (and as always, it was a shoot yourself in the head problem). The variable wasn't really being reset, but I was calling a method in MyClass that calculates what values it started with, so it looked to me like it was being reset because it ended up with the values it would...
I should probably be kicked out of the development field for not knowing this, but I'll ask it anyway. I have a Form with multiple Buttons, all of which modify the same variable. However, each time the variable gets reset. Here is what my code looks like:
Public Class frmTest
Private myvar...
I am trying to learn to program EZ-Robot (http://www.ez-robot.com/shop/) using VB.NET. I have downloaded the SDK, but the examples it included didn't really look like they did much, and the SDK documentation (http://www.ez-robot.com/SDK/) didn't seem very helpful. I would like to see a complete...
Using VB.NET and Visual Studio 2010 with Lego Mindstorms NXT
Maybe I'm asking this in the wrong place, but I was wondering if there is a way to use Visual Studio 2010 and VB.NET for Lego Mindstorms NXT. All the articles I have found use C# and usually Visual Studio 2008. I would basically like...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.