vb.net

Visual Studio Shortcut for Automatically Creating Constructors from an Inherited Class

Say I am inheriting from a class with several "overloaded" constructors. By any chance is there a short cut in Visual Studio which writes the constructors in the derived class with the same signatures as in the default class for me, with boilerplate code which calls MyBase.New(...) and plugs in the arguments for me? EDIT: As far as I ...

Where to draw the line - is it possible to love LINQ too much?

I recently found LINQ and love it. I find lots of occasions where use of it is so much more expressive than the longhand version but a colleague passed a comment about me abusing this technology which now has me second guessing myself. It is my perspective that if a technology works efficiently and the code is elegant then why not use ...

How to suppress a prompt window to continue further.

As per my application requirement I need to open each form in Access DB to count Activex controls using vb.net. My problem is, one form in the DB is prompting for user input and because of that my application stops until user intervention. Is there any way to ignore such forms and proceed with scanning DB without user intervention? Pl...

Using Me (VB.NET) keyword is it required or not?

I'm currently working on a web application (ASP.NET) and some of the pages that are included were created by other programmers, what I noticed is, they are not using "Me(VB.NET)" keyword to access controls, while on my side I used it in every page that I've created. Just to give further information, the web application runs on a .NET Fra...

How to prevent to open a MS Access Database while reading data from forms.

To count Activex controls from MS-Access forms using vb.net I am using the connection as follws.. oDBEngine = oAccess.DBEngine oDB = oDBEngine.OpenDatabase(Name:=strFullFileName, Options:=False, ReadOnly:=False, Connect:="") and Openning the forms in Design mode, as there is a user input prompt form which prevents us to run the applica...

storing first byte as string from network stream

Hi, I need to store the first byte of data read from the network stream as a string, so I can call it back later. prinf(" While 1 Dim tcpListener As New TcpListener(IPAddress.Any, 80) ' Listen to port given Console.WriteLine("Waiting for connection...") tcpListener.Start() 'Accept the pending client c...

.NET Framework weaknesses to be avoided

Dupe: http://stackoverflow.com/questions/411906/c-net-design-flaws#411919 When I learnt the .NET Framework, I was pleased with the direction Microsoft was/is taking with their application development vision. There was a great sense of enjoyment and excitement developing on the .NET platform, with some areas delivering truly impressive c...

How does object reuse work in .NET?

I've recently moved from VB6 to VB.NET and I am finally getting there with understanding the inner workings. I've been looking at my company's existing codebase and I am a little suprised. I understand that when VB.NET creates a string it see's if the string is in memory and if not creates a new instance of that string, otherwise it po...

Select either a file or folder from the same dialog in .NET

Is there an "easy" way to select either a file OR a folder from the same dialog? In many apps I create I allow for both files or folders as input. Until now i always end up creating a switch to toggle between file or folder selection dialogs or stick with drag-and-drop functionality only. Since this seems such a basic thing i would im...

What are the possibly situations that .net Viewstate could stop working?

Consider the following code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init If Page.IsPostBack Then If ViewState("test") IsNot Nothing Then Response.Write((ViewState("test").ToString)) Else Response.Write("Viewstate is empt...

Using VB.NET IIF I get NullReferenceException

I am doing a little debugging, and so I want to log the eventArgs value I have a simple line that basically does: logLine = "e.Value: " + IIf(e.Value Is Nothing, "", e.Value.ToString()) The way I understand the IIF function, if the e.Value is Nothing (null) then it should return the empty string, if not it should return the .ToString...

Marquee ProgressBar unresponsive with BackgroundWorker

In my code, when a button is clicked the progress bar is set to marquee and then my BackgroundWorker is called but when the BackgroundWorker is called the progress bar freezes or disappears. I use the BackgroundWorker to seperate the RefreshReport method of the ReportViewer from the UI thread. Any help is appreciated. Thanks! Privat...

WinForms ReportViewer: slow initial rendering

UPDATE 2.4.2010 Yeah, this is an old question but I thought I would give an update. So, I'm working with the ReportViewer again and it's still rendering slowly on the initial load. The only difference is that the SQL database is on the reporting server. UPDATE 3.16.2009 I have done profiling and it's not the SQL that is making the Re...

Why is the with() construct not included in C#, when it is really cool in VB.NET?

I am C# developer. I really love the curly brace because I came from C, C++ and Java background. However, I also like the other programming languages of the .NET Family such as VB.NET. Switching back and forth between C# and VB.NET is not really that big of deal if you have been programming for a while in .NET. That is very common appro...

Dynamic AddressOf

What is the best way of referencing a dynamic delegate. I'd like to do the following with method names returned from a configuration database. AddressOf "MethodName" ...

Good panel interface component for C#?

Any nice Paneled user interface component COM/ActiveX/Source-code for C#/VB? Like what VS has internally: Dock to screen edges Slide open/close (unpinned) Pin open Group in tabs And if possible, open-source/free. Well, because otherwise I'd have to develop an interface system myself. ...

is it possible to do inline function in vb.net?

the question is in the title ...

Why would @@IDENTITY or SCOPE_IDENTITY() be DBNull?

(resolved: see bottom) I have the following code snippet: Protected Sub SqlDataSource1_Inserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Inserted affected = CInt(DirectCast(e.Command.Parameters("@affected"), IDbDataParameter).Value) newID = CInt(DirectCas...

Do you prefer C# or Visual Basic .Net?

What do you see as benefits for one over the other? As far as I know, it's just preference. I have way more experience with C# than I do with Visual Basic and was wondering if I should dabble in Visual Basic for certain types of projects? ...

VB.Net: Set Custom Cursor from Resource File

In my VB.net project I created a custom cursor (Window.cur). How can I assign that to the cursor without having to use the full file path to that file? VB.Net has My.Resources but it does not show the cursors that are embedded in the project. I found an example that used code like this: New Cursor(Reflection.Assembly.GetExecutingAssem...