vb.net

SharePoint 'My Settings' Extra fields

In the top right corner of a SharePoint site the user can select "My Settings" to update their details etc. I am currently writing an automated app that will update user profiles from an Export we are getting on a nightly basis. My question is...can i add extra fields to the information that is stored and editable against each user? F...

Resume program execution after handling an unhandled exception

Question: I catch generally unhandled exceptions with AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf OnUnhandledException The problem now is, with this exception handler Public Sub OnUnhandledException(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs) Console.WriteLine(e.ExceptionObject.ToStri...

NHibernate: NHibernateConfigException

Hi, I'm starting with VB.NET and NHibernate but i'm getting this exception: NHibernateConfigException was unhandled An exception occurred during configuration of persistence layer. This is the code Dim configuration As New Cfg.Configuration() configuration.Configure() configuration.AddFile("person.hbm.xml") Dim f...

Update Panel Repositioning Screen

Ok so I have an update panel that updates conditionaly, and inside of it, I have 5 times the same control. The problem is this control also has an update panel, that keeps refreshing every 1 second, getting data from a table inside a repeater. Since I'm not that experienced with web developing, the only other solution I thought of was ...

Getting Information from a Shell'ed Process into the VBA Program

So, let's say that I have a VBA application inside of whatever Office Application. I have created a command-line VB.net program to do all of the fun web-services stuff. Okay, the VBA application calls Shell() to run the command line program. Now, what is the best way to get information (a tracking number for a package) from the VB.net p...

Stored procedure return varchar

Hi! I am trying to create stored procedure that gone return varchar value, and that value I need to display in textbox. This is the code for stored procedure: Create PROCEDURE Status @id_doc int, @Name varchar(50) OUTPUT AS select @Name =items.name from Doc,Items where @id_doc=IDN and doc.IDN=Items.ID return @Name This is the...

Can't upload a file with asp:FileUpload

Hi, For some reason, I'm unable to upload a file with the <asp:FileUpload /> control. I know it's not just something completely pooched, because I created a new project with this code in it and that uploaded the file. My code looks like this (some bits removed...): <form id="querydata" runat="server" enctype="multipart/form-data"> ...

Check internet connection in Silverlight

I'm writing a Silverlight 4 application and would like to check when opening the installed out of browser application, whether there is a valid internet connection (to then download some data from my website). What is the best way to do this? I realise that I could put a try catch around a WebRequest but that seems a bit hacky to me. ED...

How to read a delimited line of strings and ints and extract them for processing in VB

Hi, I have the following text file (ExamMarks.txt) John, 85, 95, 90 Micheal, 60, 75, 75 I want to extract a line and take the Name and separately and the ints separately. Then I want to print the name and the average of the numbers like this in a label: John's average is 90 Micheal's average is 70 So far I can only display what is ...

How can I execute a Minitab command via .NET?

Minitab help files provide support on this subject to a limited extent, and all examples are in VB. I am new to .NET, but I'm picking it up pretty quickly. Its something in the syntax for the command. They provide this example in VB: Dim MtbApp As New mtb.Application Dim MtbProj As mtb.Project Dim MtbCom As mtb.Command Dim i, j As Inte...

Treenode Duplicate when expanded from collapse

Items in the child node seem to replicate themselves everytime when expanded from a collapsed state. I think the problem is that the memory needs to be cleared before I expand. Can anyone see why this event would occur. Thanks in Advance. Public Sub FillTree(ByVal s As String) Dim nodeText As String = "" Dim sb As New ...

How do I reflect back the name of a Type supplied as a generic?

How to I reflect back the name of a type that is supplied as a generic parameter? I would really like to know how this is done in both C# and VB.NET. See the following example code and expected response. In C#: public void Test<T>() { Console.WriteLine("The supplied type is {0}",???) } In VB.NET Public Sub Test(Of T)() ...

Conversion failed when converting the varchar value 'Blue color' to data type int.

2 Hi! I am trying to create stored procedure that gone return varchar value, and that value I need to display in textbox. This is the code for stored procedure: Create PROCEDURE Status @id_doc int, @Name varchar(50) OUTPUT AS select @Name =items.name from Doc,Items where @id_doc=IDN and doc.IDN=Items.ID return @Name This is t...

RangeValidator not working when selecting DropDownList value using jQuery

I inherited a site which I am in the middle of updating which has a DropDownList and a RangeValidator assigned to it. The data is bound to the dropdown on Page_Load. The values are retrieved from the database so the value property of each item is set to the unique ID of the item in the DB. The RangeValidator looks something like: <asp:...

Сustom server side validation in ASP.NET + VB.NET

Hi, This has not happened to me before, but for some reason server side validation events are not being triggered: I'm using Code below <asp:CustomValidator runat="server" id="RefId" OnServerValidate="Ref_Id" ControlToValidate="txtRefId" ErrorMessage="Referral ID is Required." ></asp:CustomValidator> When I fix the debugger on below ...

Unable to access Session State from class?

I have a Dynamic Data application to which I have added a class for extending EDM. Everything works great, but now I am trying to set an entity property value equal to a value in session state - and its not recognizing the Session command. I'm trying to do something like this: audit.action_by = CStr(Session("person_name")) I think thi...

.net Masked Text Box

What is the mask for "percentage", in a WinForms application (VB.net)? ...

Create a summary description of a schedule given a list of shifts

Assuming I have a list of shifts for an event (in the format start date/time, end date/time) - is there some sort of algorithm I could use to create a generalized summary of the schedule? It is quite common for most of the shifts to fall into some sort of common recurrence pattern (ie. Mondays from 9:00 am to 1:00 pm, Tuesdays from 10:00...

ASP.NET - ascx.designer 'properties' not showing up in reflection at runtime

Hi, I have a very simple setup, single mycontrol.ascx with assoicated mycontrol.ascx.designer.vb and mycontrol.ascx.vb file. mycontrol.ascx embeds a single reference to a custom control: "MyMenu": <mM:myMenu id="myMenu1" runat="server" /> This has created a protected reference in the mycontrol.ascx.designer.vb file: Protected ...

What is the vb.net equivalent of the C# "is" keyword?

I need to check if a given object implements an interface. In C# I would simply say: if (x is IFoo) { } Is using a TryCast() and then checking for Nothing the best way? ...