vb.net

vb.net Send Smtp Mail From IIS FormatException

Well i got a page that sends emails and everything runs fine in the developer web server but when i publish to a IIS Server i get a FormatException when i try to send the mail.... ex.Message = "the specified string is not in the form required for an e-mail address." the email is in this sample [email protected] Im using the "SmtpClient...

Why am I unable to access "System.DirectoryServices" from any namespace but my presentation layer?

I am accessing active directory with the System.DirectoryServices library, currently in my web layer. However, I'm trying to move a function from a code-behind file to a VB class in another namespace, and I cannot seem to access that class from within that namespace. What gives?! ...

How to create and manage several datasets

What is the best way for me to have several datasets ? i've thought about creating a routine for creating datasets with a number in their names, each one with the desired data, but that's not very intelligent (although might work) i'd like to create what would be like an "ARRAY OF DATASETS" vb: <whatever> = ds(1).<whatever> <whatever>...

How do I access a string(index) in .Net 1.1?

I have converted this existing C# .NET 2.0 code (which appears to take in a string with any characters and return only the numbers in that string): private static string StripMIN(string min) { string result = string.Empty; int digit = 0; for (int i = 0; i < min.Length; i++) { if (int.T...

Moving from VB.Net to C#

I'm seriously considering moving from VB.Net to C#. If you made the jump to C# from vb.net, then what were the best resources you used to learn the language going from novice to pro? Thanks ...

wrong result with IF() function and a nullable integer?

I would expect the following vb.net function to return a value of Nothing, but instead its returning a value of 0... Public Shared Function GetDefaultTipoSrvTkt() As Integer? Dim tsrvDict As New Dictionary(Of Integer, DataRow) GetDefaultTipoSrvTkt = If(IsNothing(tsrvDict) OrElse tsrvDict.Count = 0, Nothing, tsrvDict.First.Key) ...

DevExpress Xtra Report: How to display a label in group footer when the detail band does not have any data?

If a have a lable called: lblWarning. I'd like to display it (Visible = True) when the detail band does not have any records. The label is in the group footer. ...

How to remove the current DataItem from being bound to a ASP.NET Repeater?

I want to evaluate the current DataItem being bound to a repeater and remove it from being added if my condition meets. I would have thought that setting e.Item.DataItem to Nothing would work, but it does not. Any ideas how to not add a DataItem to the repeater when a certain condition meets? Protected Sub rpt_OnItemDataBound(ByVal send...

Why use System.Threading.Interlocked.Decrement instead of minus?

I converted some c# code to vb.net and the converter.telerik.com turned this: i--; into this: System.Math.Max(System.Threading.Interlocked.Decrement(i), i + 1) Whats up with all the fancy-ness? ...

Error with the Using Statement and Lazy Initialized Property

The code below will throw an InvalidOperationException: The ConnectionString property has not been initialized. The exception is thrown at the line calling Connection.Open() in the Load method. If I use the try-finally statement instead of the using statement, everything works correctly. Can anyone explain why the exception occurs with t...

Strategies for testing against a live system.

Let me describe the scenario: Our VB.NET web application talks to a third party data provider via webservices. It also saves data in a HUGE SQLServer database which has extensive business logic implemented in stored procs and triggers. The webservice provider also employs convoluted business logic which is quite dynamic. The dilemma ...

Get access to an incrementing integer during LINQ Select

Dim project = new Project(1) Dim tasks = Task.GetTasks() Return <?xml version="1.0" encoding="UTF-8"?> <Project xmlns="http://schemas.microsoft.com/project"&gt; <Name><%= project.name %></Name> <Tasks> <%= tasks.Select(Function(t) _ <Ta...

How do I alphabetically sort a generic List(Of String) in VB.NET?

I've created and populated a generic list of strings like this: Dim MyList As New List(Of String) MyList.Add("Beta") MyList.Add("Echo") MyList.Add("Charlie") MyList.Add("Alpha") MyList.Add("Delta") Now I want to order it. ...

scroll using mousewheel inside panel with dynamically added picturebox controls

I've dynamically added 20 pictureboxes to a panel. i would like to see the panel scroll when I use the mousewheel. I set the autoscroll = true on panel control. Here is the code. For i As Integer = 1 To 20 Dim b As New PictureBox() b.Image = Nothing b.BorderStyle = BorderStyle.FixedSingle b.Text =...

open DB connection from DLL loaded using Reflection.Assembly

Hi, I have 2 components as below 1) a windows service that reads DLL path, properties and functions from a config file and executes the function of the DLL using reflections.Assemply --- It works perfectly fine with any DLL (without DB connection). Idea is to create a windows service which will perform any task specified in the config ...

Executing function located in code behind from JavaScript?

I am using ASP.NET 3.5. In my code behind i have this code that i want to execute from my JavaScript. Private Sub CreateName() Dim Name as String Name = txtName.text End Sub And this is my JavaScript Function <script type="text/javascript"> function doSomething() { document.elqFormName.action = 'http://now.eloqua.c...

Checking for an SQL result in VB.NET

I need to check if my SQL statement returned any results from the Access db I'm using to store my data. I have this code atm: cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\Computing Project\database.mdb;") cn.Open() cmd = New OleDbCommand("SELECT * FROM(" & roomvar.ToLower() & ") WHE...

Visual Studio is not recognizing new classes

Hi, I'm using visual studio 2008 SP1, I'm working with a web project in VB.NET. the problem when I add new class file (of-course in App_Code) it doesn't recognize it. all the old class files are working fine, but the new ones aren't. I restarted my computer and still the same problem. Any Ideas ...

secure web service

I am going to be creating a web service that will be passing confidential information across the network. What would be the best way to secure the web service? how do I know if the application requesting the information is who it says it is, and it's not another application that is using another's user name and password? ...

How do you use an Ampersand in an HTTPCookie in VB.NET?

I have a cookie saved to the user as follows... Dim searchCookie As HttpCookie = New HttpCookie("SearchCriteria") searchCookie.Item("SearchText") = FullSearchCriteria.SearchText searchCookie.Item("SearchType") = FullSearchCriteria.SearchType The SearchText stores a value they have input in a previous page. We have observed if there is...