vb.net

using Bindinglist as bind for Textbox

I have a bindinglist. i am using a textbox to show its items WithEvents xBind As New BindingList(Of Emp) I added items this way xBind.Add(New emp("alpha0", "B")) xBind.Add(New emp("alpha1", "B")) xBind.Add(New emp("alpha2", "B")) xBind.Add(New emp("alpha3", "B")) I am binding the first property to a textbox TextBox1.DataBindings.A...

Find and replace algorithm

Hello, i have some text files that contain <img width="100" or <img width="1400" or.... How could i replace all above with the following, since the image width is not static? <img width="200" ...

cast to generic type at runtime

Ok, i don't think this is possible so I thought I would ask to make sure. I'm in the process of creating a function which reflects over the properties in a class and adds them to this data structure I have. Some of the properties are generic types. So say we have DataType(Of T) that has a .Value property of type T: Dim properties = Ge...

Linq to SQL Cast Exception

Hi, I'm starting my first Linq to SQL project in VB.NET (which I am also new to). I am trying to Delete an entity but am having trouble with an InvalidCastException. The debugger breaks at the Next statement in the ForEach loop. My entity class is called Material. Any help would be very much appreciated. Thanks, Kenneth Di...

unrecognizable code in classic ASP; need .NET conversion

oXML = Server.CreateObject("Msxml2.DOMDocument.4.0") oNode = oXML.createElement("CommonCustomerSearch") can someone explain what the lines of code above are doing? i'm more interested in the first line as the method it is written in exits when it hits that line, so apparently the variable oXML isn't being set. i know that oXML is supp...

ASP.net/jQuery: JSTree, selecting Node, can't seem to get ID

Currently, I'm using an AJAX Handler to populate the JSTree: $(function () { $("#jstree").jstree({ "json_data": { "ajax": { "url": "AJAXHandler.aspx?action=GetMenu" } }, "plugins": ["themes", "json_data", "dnd"] }) .bin...

Attaching PDF files in VB.NET

Dear All, I have a requirement and that is as follows: Aussume that i have a windows form in which i type all the details of an employee and i need to attach his resume [ which is in a PDF Format] to his details. When i click the save button, all his details which he has entered can be stored into a table. Now what i really want is th...

executing SELECT statement with date in WHERE clause fails

I'm building a dynamic query in my ASP.NET MVC project by the following: Dim queryString As String = "SELECT VALUE userInfos FROM MyDBEntities.UserInformations AS userInfos" If strWhere <> "" Then queryString = queryString & " WHERE " & strWhere End If ' Call the constructor with the specified query and the ObjectContext. Dim Sear...

Is there a VB.NET plugin for CodeRay (or any VB.NET syntax highlighting)?

I recently set up a Redmine server for my time. Redmine's Wiki uses CodeRay for syntax highlighting. However, most of my team prefers to code in VB.NET, which CodeRay doesn't support. Are there any plugins out there that offer syntax highlighting for VB.NET in CodeRay? If not in CodeRay, maybe through some other library (that could be i...

Invert an Enumeration in VB.NET

I need a NOT operation on Enumeration in VB.NET (.NET 2), is it possible? <DefaultValue(0)> _ Public Enum Orientation Descending = -1 Undefined = 0 Ascending = 1 End Enum by ex define a Not operation in order to do myObj1.Orientation = Not myObj2.Orientation Rules: Desceding > Ascending, Ascending > Desceding, ...

Insert multiple items into List or Array (no Linq and not quite CodeGolf)

No matter how I try, I can't seem to create a nice and clean algorithm for doing the following: System.Array (or generic List) data of System.Object System.Array (or generic List) xval of System.Object System.Array (or generic List) idxs of System.Int32 xval and idxs contain the same number of elements and idxs contains no values les...

Auto resizing wpf elements with scroll bars (Rich text box, list box) vb

Hey guys, I'm having a problem where I have elements such as Listboxes and Rich Text boxes that I want to set to size automatically in xaml according to the size of the window, but I only want it to resize to the size of the window and then put scrollbars if the content is any bigger than that. Unfortunately, the only way I can get scr...

Updating a Master Page from a View

I have an ASP.NET MVC 2 project that renders conventional strongly typed pages, but on some of these pages I also want to use the page's object to render a specific area (div) in the navigation section of the Master Page. For example, if I have a Client object and associated strongly typed View, I want the View to be able to insert clie...

What should I write for vb.net datagridview if I want to get same result?

I have used mshflexgrid for my vb.net program. But it shows error when I try to build because vb.net doesnt support mshflexgrid. Please check my code & tell me what should I do to do same thing there in datagridview? Datagridview doesnt support same code. So would you please tell me what should I write for it? Please check my code. Publ...

bind field at run time Crystal report

I want to create a column on a crystal report. I am binding crystal report to .net class object collection at run time. Now one of the columns I need to bind to the object collection property which is another object to it’s property. How do I do this ? ...

Remove dupe rows from DataTable

_CheckPayees = ds.Tables("Payees") _CheckPayees is a DataTable variable. After it is set with the code above, I would like to go through it and remove duplicate rows from it. These rows have to be exactly dupes though, say two columns have matching values however another one doesn't, that's not considered a dupe. Is there an easy way ...

Exception being thrown in designer-created code instead of user code

In my project, I have a local dataset (XSD) that I am using as local-temporary tables. I am getting a System.InvalidCastException when trying to access the field in one the tables. I believe this is because I my code is (incorrectly) not setting a field's value in a row before trying to access it. My problem is that the exception is bre...

linq query to get monthly expenses in vb.net

I have a collection of order objects (properties - date, amount and vendor). I need to prepare a report showing spend by vendor by month since 01/01/2009. How can i get the results using LINQ? ...

wcf serving on vindows service on the virtual machine communication error

Hi, I have a wcf hosted on vindows service. It works fine. However If I install service on to the virtual image and try to consume from the actual image it returns communication falt error. Is there any specila configuration for that? Regards Reside ...

asp/vb6 to .net 2.0 - help

oXML = Server.CreateObject("Msxml2.DOMDocument.4.0") oNode = oXML.createElement("CommonCustomerSearch") oRoot = oXML.appendChild(oNode) can someone post a .NET 2.0 equivalent of the above lines of code please? i actually found some sample code that seemed to be what i was looking for, but i believe it was using .NET_4 classes. i need a...