vb.net

How do I use Linq-to-sql to iterate db records?

I asked on SO a few days ago what was the simplest quickest way to build a wrapper around a recently completed database. I took the advice and used sqlmetal to build linq classes around my database design. Now I am having two problems. One, I don't know LINQ. And, two, I have been shocked to realize how hard it is to learn. I have...

Visual Basic .NET Help

How can I get this code into a loop? contact.first_name = list.Item(0) contact.middle_name = list.Item(1) contact.last_name = list.Item(2) contact.age = list.Item(3) contact.mobile_phone = list.Item(4) contact.home_phone = list.Item(5) contact.work_phone = list.Item(6) contact.home_street = list.Item(7) contact.home_city = list.Item(8) ...

Object reference not set to an instance of an object

Can anyone help with the following code? I'm trying to get data from the database colum to the datagridview... I'm getting error over here "Dim sql_1 As String = "SELECT * FROM item where item_id = '" + DataGridView_stockout.CurrentCell.Value.ToString() + "'"" Private Sub DataGridView_stockout_CellMouseClick(ByVal sender As Object, ByV...

How do I use the Windows API Code Pack in VB.net 2010 Express?

Hi all, I recently downloaded the Windows API code pack for .net, and seeing there was VB.net examples inside there, I opened them up. Upon building I get a warning that the referenced components 'Core' and 'Shell' could not be found. Looking in the code pack folder I see there are no DLLs at all, but instead a whole load of C# sources. ...

Looking for an algorithm in vb.net or c# but I don't know it's name!

I'll do my best to explain what the algorithm is supposed to do: There's a class 'Recipe'. Each Recipe can include other Recipes but cannot include itself or any other Recipe that includes it. So, a simple example is we have just two Recipes A & B. If A adds B first, then later on B cannot add A because it will cause a loop. A more ...

Unity setting problem when defined in code

I have problem when asking for default ILogger from Unity container. I have this setting defined in code (its VB.net) Dim container As IUnityContainer ... container.RegisterType(Of ILogger, NullLogger)() container.RegisterType(Of ILogger, EntLibLogger)("EL") When I am getting ILogger from container I may have different name, like: ...

Specifying a unique control name when adding at runtime (like the VS IDE)

hi, I have a basic IDE for a user control i am building. It allows me to add labels to a panel and move them around, like a very basic form designer. When I add the controls to the panel at runtime, I'd like to give the control a unique name string like how the VS IDE tracks the controls it already has and adds an extra number when it ...

Can you data bind to a property that contains parameter in Silverlight?

In silverlight, can you bind to a property that contains parameter? For example, the following doesn’t seem to work. Am I missing something or is this not possible? C# private System.Collections.Generic.Dictionary<string, string> ValuesField = new System.Collections.Generic.Dictionary<string, string>(); public string Value { get { ...

How to catch all un-handled exceptions in a .net assembly (library type, not application).

Hi, I have an assembly containing a number of classes. This is a class library type assembly, not a windows forms application. It's also single threaded. Is there a way to catch all un-handled exceptions so that I can log them? ...

How do I set a VB.Net ComboBox default value

I can not locate the correct method to make the first item in a combo box visible. The app starts with an empty combo box. The user makes a radio box selection then clicks Go! (how original). The combo box is loaded via an LDAP query. All this is working just fine. The problem is the combo box still appears to the user to be empty. They...

Console.Write Not Working In Win Forms App

I created a VB.NET Windows Forms Application in Visual Studio 2008. When I run my program from the command-line, I get no output (only the next prompt). What am I doing wrong? Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Debug.Write("Foo") Debug.Flush() Console.Writ...

[ASP.NET] How can I HTML-encode a string and use human-readable encoded tags (ex: &ecirc; instead of &#234; )

Greetings, I'm looking for a way to encode a string into HTML that uses human-readable tags such as &ecirc; (=ê). At the moment, I am using the HttpUtility.HtmlEncode() function, but it appears to return numbered tags instead of human-readable ones. For example: Dim str as string = HttpUtility;HtmlEncode("vente - en-tête") 'Expected: ve...

Prevent Console Return

Can a VB.NET Windows Forms Application be configured so that when run from the command-line, the command-line waits until the application exits before showing the next prompt? ...

How to fill out a form field without a name in webbrowser control?

In the past, I used the code below to fill out a form field using the webbrowser control in VB.Net. The page I am working with doesn't have name field for the inputbox, so my code doesn't work. How would I fill out the input box defined at the bottom of this post in bold? Dim iPage As HtmlDocument iPage = wb1.Document iPage.All.Item("ca...

Align Button on a grid with InkCanvas

I am using an InkCanvas to arrange buttons. (resize, position). Does anybody know an easy way to align these buttons automatically on a grid. I.e. I only want to allow every tenth pixel to be a valid corner for a button that is moved around. ...

Send a String From Child Application to Parent

My VB.NET WinForms program (parent) calls another VB.NET Console program (child) with Process.Start(). The child application runs quickly and I would like a status message returned to the parent. How can I send a string from the child to parent? Is there some built-in way because of the parent-child relationship or must I use some oth...

How can we serialize a class that is not a custom class of our own?

I need to look at the properties of an object and I cannot instantiate this object in the proper state on my dev machine. I need my client to run some code on her machine, serialize the object in question to disk and then I can analyze the file. Here is the class I want to serialize. System.Security.AccessControl.RegistrySecurity Her...

.Net reflection to get description of class / property etc?

Hi, I know its unlikely but I was wondering if there is any way to get the comments (i.e. the bits after the ''') of a class or property..? I have managed to get a list of properties of a class using the PropertyInfo class but I cant find a way to get the comments / description.. I need it for a guide I am writing for the administrators...

informations are not written to a file why?

Hello iam trying to write information about customer from textboxes to a file.txt. when iam clicking save button, stream is opened, then i used method writeline(txtboxevalues) but no information are written to the txt file any help in that?? THanks.. ...

Choosing a Custom default combo box value in VB.NET

Hi, I got a combobox which is filled with values from datasource. By default the first value is chosen which is fine but I need to display "Choose country" as the default combobox text. The user then can choose from the drop down list. The reason is when the first value from datasource is chosen as the default value the rest of the ...