vb.net

Using early binding on a COM object

Hello, I have this piece of code that works very well and gives me the path the user's start menu: Dim oShell As Object = CreateObject("Shell.Application") MsgBox(oShell.NameSpace(11).Self.Path) This obviously uses late binding. Now say I want to do this in C#, or in VB.NET strict mode, neither of which support this kind of s...

Opening an image in vb to send into a database - Asp.Net

I'm currently patching an asp.net program where I need to be able to send an image to an SQL Server 2005 DB. It works fine when I use the asp:fileupload control, but the trick is that when the user deletes the image, I'm supposed to replace it with an image from the server saying "empty", in code-behind. I know how to open, use and save...

Adding and updating a record programmatically using .NETCF

OK - I have worded this search 40 different ways and I seem to be lost here. Every example I find seems so happy that you can easily drag and drop a datagrid and let the user fill it in -- then they stop! I know how to do everything I am asking through LINQ. That obviously won't translate here. I really should have learned ADO.NET first...

How can I have a dynamic URL in generic class

I need to have a dynamic URL preferably from a Test Class. Can any one help me in formatting this design pattern to handle dynamic links from tests. instead of a constant HomePageURL. Namespace TestDesign Public Class HomePage Inherits IE Public Const HomePageURL As String = "testlink" Public Sub New() MyBase.New(H...

Declaring an nvarchar in VB/Matching an nvarchar in a SQL query

I'm working on an ASP.NET application that uses VB. I'm using a SQLReader/SQLCommand/SQLConnection within the VB file to try to pull data values. I was mystified to find out that the reason why the query wasn't returning any values, and someone here showed me how to troubleshoot the query to verify things were being returned, which they...

How can I just get an IfxBlob from am Informix query in .net?

I can't seem to find a way to get just the locator object of a column under .Net. It seems that Informix is automatically converting the blob column to Byte[] and not leaving a way to change that behavior. IBM.Data.Informix.IfxConnection c = new IBM.Data.Informix.IfxConnection("..."); c.Open(); IBM.Data.Informix.IfxCommand c...

VB Brackets in Enum?

I'm finding this in some legacy code and just curious what the brackets are for? Public Enum myEnum none = 0 abc = 2 def = 4 ghi= 6 [jkl] = 8 mno = 9 End Enum ...

Copying multiple worksheets simultaneously to preserve chart references

I've created a two-worksheet template in Excel - the first sheet is for pretty charts, and the other sheet is for the data that drives those charts. I've written a vb.net 2005 app that can dump in all my data on the second worksheet, and the chart worksheet updates perfectly. I would like to do this report several times over in the sam...

.NET SMTP SendAsync with AlternateViews throws disposed exception

I am trying to send E-mails asynchronously and it works fine as long as there isn't an AlternateView attached to the e-mail. When there is an alternate view, I get the following error: Cannot access a disposed object. Object name: 'System.Net.Mail.AlternateView' System.Net.Mail.SmtpException: Failure sending mail. ---> System.ObjectDis...

VB.NET loop through audio

I would like to loop through audio in VB.NET. Here is my code: While blnAlert = True My.Computer.Audio.Play("C:\cat_1.wav") End While But it freezes the app. Cheers. ...

Retrieve Last Updated Record

Hi How can i retrieve last updated EmpID form sql database. ...

VB.NET getting the attributes of a .wav file

How do I get the attributes of a .wav file using VB.NET. In particular, I am looking for a property which has the Duration of the .wav. Cheers ...

To access .UDL file from the sqlclient connection

Hi, I have a .udl file with the following connection string in it [oledb] ; Everything after this line is an OLE DB initstring Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Client_DB050208;Data Source=IAEADB\IAEADBDEV;;Network Library=dbmssocn Now i am trying to access this .udl file from the...

ASP.NET: Getting all the page's control as IEnumerable

Hi, I'm trying to use the page control's collection with LINQ. Whereas this works: dim l = Me.Controls.OfType(Of TextBox).AsQueryable() the following return an ArgumentExceptionError: dim l = Me.Controls.AsQueryable() I need all the controls. Any help? Thanks ...

Can I use the AJAX Autocomplete extender *without* a webservice?

Using ASP.NET 3.5 with VB codebehind. I don't want to use a webservice to populate an autocomplete extender on a textbox. In this case, it's where the user is entering email addresses and I don't want to make a trip to the database every single time. I'd much rather keep a collection in session state and 'bind' the autocomplete to tha...

VB.net Raising Events ...confusion! MVC

I'm new to MVC and Business Objects but I'm struggling to understand how to trigger a refresh on a form when an update occurs in my business logic. This isn't an issue for 95% of my forms because they call the update from the form that needs to be updated. However, In some cases an inner form does and update that requires an outer form...

How do I convert Elevated Privilege code from C# to VB.Net for use with SharePoint?

I have built a method to pull some UserProfile information out of SharePoint. It works great in C#, but I can't figure out how to convert one part of it to VB.NET. I'm not that great at VB but usually the basic code converters online get me past any problem I have. The problem is concerning the SPSecurity.RunWithEleveatedPrivilages secti...

Is there a way to create automatically create properties from a SQL Server database?

Using Visual Studio .NET 2008 or 2005, is there a way to automatically generate properties for each column in an SQL Server database table? I am assuming other code-generation software exists that will do this. I know with Visio I can connect to my database and it will generate diagrams by table, this would be similar to that. ...

Most Efficient/Elegant Address Validation

I made this small location class so that I can better handle address information which I am going to be sending off in requests to the Google Maps API. One thing I have left to do is some validation to make sure that the address has enough information to return a result back. For the application, the level of accuracy should be as loos...

Setting dropdown values with nullable types

I've written a small utility function for our base page, it works fine in most cases, but if it's called in the form SetDropDownValue(dropdown, Nothing, True) I have to specify the type T. Since the compiler only requires a type specified when the type is not used, I'm wondering if there is a better way to write the code. The method is...