I'm not sure how to describe this but I'm trying to create a base class that contains a shared (factory) function called FromXml. I want this function to instantiate an object of the proper type and then fill it via an XmlDocument.
For example, let's say I have something like this:
Public Class XmlObject
Public Shared Function Fro...
Hi,
I've been programming for a while and have used LINQ-To-SQL and LINQ-To-Entities before (although when using entities it has been on a Entity/Table 1-1 relationship - ie not much different than L2SQL)
I've been doing a lot of reading about Inversion of Control, Unit of Work, POCO and repository patterns and would like to use this m...
The Vb.Net application creates a bitmap from scratch and either converts to a tiff or sends it to a printer. In both cases, the quality of the image (in this case the font) is not good at all. The sample code listed below creates the graphics object that I use to write to the image.
Dim gr2 As Graphics = Graphics.FromImage(New Bitmap(8...
I'm using the code below to take a string and split it up into an array. It will take: Disney Land and make it two separate elements. If the string contains "Disney Land" then it is one element in the array. Works great, however it adds some empty elements to the array each time. So I just iterate over the elements and remove them i...
Is there a VB.NET equivalent to the C# var keyword?
I would like to use it to retrieve the result of a LINQ query.
...
I have a treeview control where I am dynamically selecting a node depending on user interaction. when a node is selected I want to be able to have the scrollbar go to the location of that selected node in the tree. The scrollbar is simply made by overflow:auto in the div tag where the treeview is located. Can someone give me some detaile...
The selector expression for LoadProperty must be a MemberAccess for the property.
I'm converting some C# to VB, this is the C# line:
entities.LoadProperty((MyType)MyTargetObject, c => c.MyProperty);
I convert it to VB like so:
entities.LoadProperty(DirectCast(MyTargetObject, MyType), Function(c) c.MyProperty)
However I get the err...
I have like 10 aspx pages (junior_class_students1.aspx-...10.aspx). They all have the same master page in the back (class_students.master). Everytime i load a page i want the master page background-color to change, to the one that i can specify per page.
so ...students1.aspx then .master
...students2.aspx then .master
...students3.asp...
Hi everybody
I'm pulling my hairs off since two days now because I'm trying to download an image from a website using HttpWebRequest.
When I call the method "GetResponse" of that class, I get the WebException "Unable to connect to the remote server.". The inner exception is "A socket operation encountered a dead network xxx.xxx.xxx.xxx:...
I am trying to parse a file generated by LGA Tracon that lists the position data for aircraft over a given time frame. The data of interest starts with TRACKING DATA and ends with SST and there are thousands of entries per file. The system generating the file, Common ARTS, is very rigid in its formatting and we can expect the column sp...
I have a very long running syncronization task that cannot be interrupted by the screen saver or aggressive power saving modes. I want to make a single api call to stop power save mode and then restore it once the task is done.
The following code is peaced together from various other posts but it has no effect on XP's power management s...
I'm creating a reporting application, and our customers are going to need to generate some pretty big reports which require quite a bit of memory. Ive been in a re-factoring mood lately, so I was wondering what the best way to access the properties of another open form would be(The reporting viewer opens in a new form.) So far I have:
...
I am using an XMLTextWriter to create an XML document dynamically (in VB.Net).
I want empty tags to appear like this - <Tag></Tag>
and not this - <Tag />
So, I am using WriteFullEndElement to end the element tag. But it is writing out the tag as -
<Tag>
</Tag>
i.e. with a newline character between the tags. The web service reading t...
I have a Label control on the form with small text.
i want to be displayed - rotated counter clockwise by 90 degree
VB.NET / Visual Studio 2005
Windows Forms Application
Any ideas
...
I want to setup values for a combobox in vb.net through code. But I don't know what's the code for setting it up. please help.
I want to do something like this:
if combobox1.selecteditem="1" then
combobox2.values=("x", "y", "z")
end if
...
While playing with Linq Group By statements using both DataSet and Linq-to-Sql DataContext, I get different results with the following VB.NET 10 code:
#If IS_DS = True Then
Dim myData = GetOrdersDS
#Else
Dim myData = GetNwDataContext
#End If
Dim MyList = From o In myData.Orders _
Join od In myData.Order_Details On o....
Hi guys,
Is there any way to turn the damned error provider off when i try to close the form using the windows close button(X). It fires the validation and the user has to fill all the fields before he can close the form..this will be a usability issue because many tend to close the form using the (X) button.
i have placed a button for...
This is a winform and I'm using mysql as a database, here is my code:
I'm trying to add data into multiple tables.
If TextBox14.Text = "" Or TextBox7.Text = "" Or TextBox10.Text = "" Then
MsgBox("Please fill up the fields with a labels in bold letters!", MsgBoxStyle.Information)
cn = New MySqlConnection("Server...
In my master page I have a top-level menu that is created using ActionLinks:
<ul id="topNav">
<li><%=Html.ActionLink("Home", "Index", "Home")%></li>
<li><%=Html.ActionLink("News", "Index", "News")%></li>
<li><%=Html.ActionLink("Projects", "Index", "Projects")%></li>
<li><%=Html.ActionLink("About", "About", "Home")%></li>
<li><...
I need to dynamically create textbox.
This is my code, but with this I create only one textbox:
Public Sub CreateTextBox()
Dim I As Integer
Dim niz As Array
For I = 1 To 5
Dim myTextBox = New TextBox
myTextBox.Text = "Control Number:" & I
Me.Controls.Add(myTextBox)
Next
...