vb.net

ASP.NET XML ObjectDataSource Wrapper Class Examples

I want to use XML instead of SQLServer for a simple website. Are their any good tutorials, code examples, and/or tools available to make a (prefer VB.NET) wrapper class to handle the basic list, insert, edit, and delete (CRUD) code? The closest one I found was on a Telerik Trainer video/code for their Scheduler component where they us...

How would you extract data from a MS Project .mpp file?

I need to extract data from a .mpp file on the network and combine it with other data from several different databases. The application can be written in Perl, VB6, VB.net or C# but must be easily scheduled from a Windows based server. What would you recommend to extract the MS Project data with no user intervention? Is there any ODBC...

How should I cast in VB.NET?

Are all of these equal? Under what circumstances should I choose each over the others? var.ToString() CStr(var) CType(var, String) DirectCast(var, String) EDIT: Suggestion from NotMyself TryCast(var, String) ...

vb.net object persisted in database

How can I go about storing a vb.net user defined object in a sql database. I am not trying to replicate the properties with columns. I mean something along the lines of converting or encoding my object to a byte array and then storing that in a field in the db. Like when you store an instance of an object in session, but I need the info ...

App.config connection string Protection error

I am running into an issue I had before; can't find my reference on how to solve it. Here is the issue. We encrypt the connection strings section in the app.config for our client application using code below: config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) If config.ConnectionStrings.Sect...

How do I determine which process is using a serial port?

The company I work for makes hardware that communicates to the computer though a serial port. Third party companies write software that communicates with our hardware. There are times when I need to diagnose our hardware. However, a third party software app connects to the serial port when Windows starts up, blocking any other connecti...

ASP.Net: why is my button's click/command events not binding/firing in a repeater?

Here's the code from the ascx that has the repeater: <asp:Repeater ID="ListOfEmails" runat="server" > <HeaderTemplate><h3>A sub-header:</h3></HeaderTemplate> <ItemTemplate> [Some other stuff is here] <asp:Button ID="removeEmail" runat="server" Text="X" ToolTip="remove" /> </ItemTemplate> </asp:Repeater> And in th...

What's wrong with this code? If anything.

Essentially I want to know if in VB.NET 2005 if using a sqlcommand and then reusing it by using the NEW is wrong. Will it cause a memory leak. EG: try dim mySQL as new sqlcommand(sSQL, cnInput) // do a sql execute and read the data mySQL = new sqlcommand(sSQLdifferent, cnInput) // do sql execute and read the data catch ... final...

Extract Address Information from a Web Page

I need to take a web page and extract the address information from the page. Some are easier than others. I'm looking for a firefox plugin, windows app, or VB.NET code that will help me get this done. Ideally I would like to have a web page on our admin (ASP.NET/VB.NET) where you enter a URL and it scraps the page and returns a Dataset ...

How do I best populate an HTML table in ASP.NET?

This is what I've got. It works. But, is there a simpler or better way? ASPX Page <asp:Repeater ID="RepeaterBooks" runat="server"> <HeaderTemplate> <table class="report"> <tr> <th>Published</th> <th>Title</th> <th>Author</th> <th>Price</th> ...

How do I best generate a CSV (comma-delimited text file) for download with ASP.NET?

This is what I've got. It works. But, is there a simpler or better way? One an ASPX page, I've got the download link... <asp:HyperLink ID="HyperLinkDownload" runat="server" NavigateUrl="~/Download.aspx">Download as CSV file</asp:HyperLink> And then I've got the Download.aspx.vb Code Behind... Public Partial Class Download Inheri...

Why does a button control need to be clicked twice?

I've got a web application working using VB and Ajax. I'm using updatepanels to avoid the irritating "flicker" on postbacks to the server. I would like to have a button control defined within the updatepanel itself (tried moving it outside and got some catastrophic error, so left it there) that makes the current panel not visible and ...

How to ensure that the same thread is used to execute code in IIS?

We have a third party dll that is used in our web service hosted in IIS6. The problem is that once this dll is loaded into memory, the exception AccessViolationException gets thrown if a thread different then the one that created it tries to execute any code within the dll. The worker process is multi threaded and each call to the web se...

VB.NET Empty String Array

How can I create an empty one-dimensional string array? ...

I need help with a MenuStrip Error

My users are having an intermittent error when using a Windows Forms application built in VB.NET 3.5. Apparently when they click on the form and the form re-paints, a red 'X' will be painted over the MenuStrip control and the app will crash with the following error. Has anyone seen this before? Can someone point me in the right direction...

How do I lock certain SQL rows while running a process on them?

My work has a financial application, written in VB.NET with SQL, that several users can be working on at the same time. At some point, one user might decide to Post the batch of entries that they (and possibly other people) are currently working on. Obviously, I no longer want any other users to add, edit, or delete entries in that bat...

Is there anything wrong with this query?

INSERT INTO tblExcel (ename, position, phone, email) VALUES ('Burton, Andrew', 'Web Developer / Network Assistant', '876-9259', '[email protected]') I've got an Access table that has five fields: id, ename, position, phone, and email...each one is plain text field with 50 characters, save for position which is 255 and id which is an aut...

Best way in asp.net to force https for an entire site?

About 6 months ago I rolled out a site where every request needed to be over https. The only way at the time I could find to ensure that every request to a page was over https was to check it in the page load event. If the request was not over http I would response.redirect("https://mysite.com") Is there a better way -- ideally some s...

VB.NET FormatNumber equivalent in C#?

Is there a C# equivalent for the VB.NET FormatNumber function? I.e.: JSArrayString += "^" + (String)FormatNumber(inv.RRP * oCountry.ExchangeRate, 2); ...

How to iterate a jagged array?

This has been driving me crazy for a few days. Why doesn't the following work? Dim arr(3, 3) As Integer For y As Integer = 0 To arr.GetLength(0) - 1 For x As Integer = 0 To arr.GetLength(y) - 1 arr(y, x) = y + x Next Next Also, what if the array looked like this instead? { {1, 2, 3}, {4, ...