vb.net

Examine the file content being uploaded

I'd like to get both C# and VB.NET sugestion. I have an ASP.NET FileUpload control, which allows only image type. I used RegularExpressionValidator like below. <asp:FileUpload ID="fuPhoto" runat="server" TabIndex="40" /> &nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runa...

We just create a reference of string class without making a object of it and start using it, how is it possible?

String s = "test"; String is a class, so to use it we should create an object of it. But rather we just make a reference of it and give it a value. How is it possible and what concepts are used in it. The metadata of String class shows the following : public sealed class String : IComparable, ICloneable, IConvertible, IComparable<st...

Is there a simple way to handle base 13 (or generic base N)?

I can quickly knock together soem code to xlate base 10 to/from bae 13, but I just wondered if something very easy already exists in VB.NET (or even somethign generic, with base N, but right now I am only looking at base 13) ...

vb.net untyped arguments

Is it possible to have an argument of any type? Here's what i mean: some_function(argument) if (argument type is string) do something with a string else if (argument type is datarow) do something with a data row ... I've found something about generics, but i'm not sure if it's what i want. ...

vb.net Getting a reference to a class by its name

Hello, I'm trying to use reflection to get the instance of a class in vb.net. I have a class 'A' in my web project and to test it, i create a new aspx page and try to write the following: Dim t as Type = Type.GetType("A") This returns "Nothing". But if i do this: Dim inst as A = new A() Dim t as Type = inst.GetType() t's type is "...

How can I check the final type of a variable?

I have a BaseClass, a DerivedClass1 and a DerivedClass2 from a third party library. DerivedClass1 and DerivedClass2 both inherit from BaseClass. There's a ContainerClass, from the same library, with a member variable ActiveItem, which can be of DerivedClass1 or DerivedClass2, so it is declared as BaseClass. I want to know if ActiveItem...

How to get a return value from a stored procedure in VB.NET

Dear All, I have a stored procedure in SQL Server for generating transaction numbers. Can anyone help me with how to call the Stored Procedure from VB.NET and how will i get the value that is returned from the procedure into the front end. Regards, George ...

Loading ScriptManager only once either from Master page or Content page

I have an web application of 200 web pages and all has a single master page. Most of the content pages use AJAX controls so most of content pages has its own ScriptManager. Now I have a requirement to add a link with HoverMenuExtender control and for that I need to put ScriptManager in the Master page, but it is working only in the conte...

linq return only one row

I am using linq over dataset have multiple columns and grouping on one column with this code: Dim Groups = From n In data _ Group n By s = n.Field(Of String)("name") Into Group Select s but it results in only the first row and I checked the data it's supposed to return 13 rows. ...

Why assembly namespace coming twice?

I am calling my business layer project in Web Project. I added refress business layer project to Web. When I call class in BL project, I need to write twice this namespace. I dont know why it is coming. MyCompanyName.HRHead.DataLayer.MyCompanyName.HRHead.DataLayer.User I suppose to call MyCompanyName.HRHead.DataLayer.User In my BL...

In VB.NET, how do you override a function and call a function with the same name from the grandparent superclass?

I am attempting to inherit an ASP.NET RegularExpressionValidator and add some functionality to it. I inherited the control and added my custom properties. However, I would also like the client-side functionality to call a different JavaScript function. In order to do that, I will need to supress what is happening in the AddAttributesToR...

How to loop through points in a system.drawing.rectangle in vb.net

Looking for something like: dim rect as system.drawing.rectangle For each point in rect Debug.print(point.name, point.value) Next ...

DataGridView columns still automatically created even with AutoGenerateColumns = False

I have a DataGridView and have the AutoGenerateColumns property set to false, but the when I build my project the columns are Auto Generated. I can see the property set to false in the Designer.vb code for the Form. I've had this problem before and I'm not sure how to fix it. Any advise would be greatly appreciated. Thanks. ...

How to create HTML fieldset and legend in asp.net code behind?

How to create HTML fieldset and legend in asp.net code behind? and add controls in that fieldset? ...

Calling Stored Procedures from VB.NET

Dear All, Can anyone please help me on the following: I have created a SQL Server stored procedure as follows: create procedure prcGet_sub_menu_list @sub_menu char(5) as begin select 'menu_code' = menu_code 'menu_name' = menu_name from sub_menu_master where menu_code = ...

vb.net - sharing mdb access connection among multiple forms

I'm starting to put in a database into my application, however I'm drawing a blank on how to share a database connection among the dozen or so different forms in my MDI application. I'm assuming this has to do with interfaces or something but I can't find any relevant examples anywhere. Can someone help me out? Ideally what I'd like is w...

creating a project with one exe file and remaing with dll

i wanna a create a project with one .exe file and remaining files as .dll. i have 24 forms in my windows application. am using Vb.net ...

VB.NET ReportViewer: Merged columns when exporting to Excel

I'm using a reportviewer in VB.NET. When the user exports a report to Excel some of the columns get merged and hidden. is it possible to fix this? Maybe by manipulating some code or a setting somewhere..? ...

Parsing Data in Silverlight

I have a design question about parsing data in Silverlight. I need to allow my users to validate their csv data (they paste ten rows into a textblock), but I am not sure if I should attempt to do it on the client side where I don't have access to the textfileparser class or send the data to a webservice for validation. If I send it to ...

Language choices when porting a classic asp app to .NET

First, let me ask you to consider this as a real question, and not a subjective one. That out of the way, here's my situation: We are looking to port our existing classic ASP application to .NET, but we're unsure of what language to use for the new app. I personally would 'prefer' C#, as I'm more familiar and comfortable with that lan...