vb.net

vb.net - multi-dimension array list

I've managed to make some single dimension array lists but I can't figure out a multi dimension arraylist. Here's what I'm trying to do: I have a database (mdb) with 5 columns that I want each row to be in an array list. In PHP what I'd typically do is: $array[$field1] = array($field2,$field3,$field4,$field5); How I do the same in v...

Set dropdownlist in gridview in rowediting event

Trying to get the findcontrol to work so I can set the default value of the dropdownlist I have in a template field, but I'm having no luck. Am I doing something wrong? Dim drdList As DropDownList For Each row As GridViewRow In gridviewComputer.Rows drdList = gridviewComputer.Rows(e.NewEditIndex).FindControl("statusDropDown...

Manipulating data from an Oracle temporary table in VB.Net

Hello, I have a VB.Net application that populates an Oracle 11g global temporary table. I can see data in the temporary table by loading it into a grid and everything looks correct. However, when I call an Oracle stored procedure from VB.Net that would manipulate the data in this temporary table, the stored procedure reports that my te...

vb.net implimenting IAsyncResult.AsyncState

I can easily do this in C#...but I need the equivolent in VB.Net. I need to be able to implement various IAsyncResult properties in VB.Net. IN C# Works like a champ... public object AsyncState { get; set; } IN VB.NET - THIS FAILS This fails because you cannot overload a property in VB.Net Public ReadOnly Property AsyncState() As ...

PostBackUrl in RadPanelBar Telerik

Greetings everyone.. i would just like to ask.. how do i assign a postback url in my radpanel items in my master page Eventually i have a MasterPage wherein i construct my radpanelbar.. and i have this Item Quiz with a child name Create What i want to achieve is when i hit the button Create in my radpanelbar it will make a PostBackU...

I tend to use If Not IsDBNull(dr("data")) Then... for reading from a data reader is there a better way?

I tend to use If Not IsDBNull(dr("data")) Then myData = dr("data") End If to catch nulls. Is there a better way? It seems I use this over and over again? Anyone write a function to check this something like mydata = IfNotNull("data") I don't know how to handle the different data types that could be returned. Thanks for any th...

.NET SyncLock order deadlock

If I have two Synclocks synclock a synclock b end synclock end synclock am I in danger of a deadlock if I never have synclock b synclock a end synclock end synclock in my code, but I do synclock on a or b randomly? ...

How to capture HTML of redirect page before it redirects?

I am trying to read the HTML of a page that contains a non-delayed redirect. The following snippet (C#) will give me the destination/redirected page, not the initial one I need to see: using System.Net; using System.Text; public class SomeClass { public static void Main() { byte[] data = new WebClient().DownloadData("http:/...

SQL Stored Procedures failing to return values

I am working on a Tag system for a news page designed in ASP.NET. For the system I require a TagExists method to check for tags within the database. The stored procedure I have written is below. ALTER PROCEDURE [dbo].[Tags_TagExists]( @Tag varchar(50)) AS BEGIN If (EXISTS(SELECT * FROM dbo.Tags WHERE LOWER(@Tag) = LOWER(Tag))) ...

Retrieve user information and check if member of a group in active directory using VB.NET

I'm using the following code, which works, to login a user to an application built in VB.NET against active directory. This code works great but I need to retreive the user's first name, last name, display name and also check if the user is part of a group. I've tried many forms of adResults.Property("displayname").ToString() and the l...

Converting month name to integer

I did a quick search for this and was surprised not to find it anywhere. Basically looking to convert full month names (January, September, etc) to the equivalent number that would be used in mm/dd/yyyy format. I can put together my own array and pull it out accordingly, but there has to be a quick and straightforward method already. R...

Why textbox id not allowing to start with numeric in asp.net?

I have to give textbox control id like below <asp:TextBox ID="7_1" runat="server"> It is not allowing me. If I give <asp:TextBox ID="Test7_1" runat="server"> Then it works fine. Why? Why can not give start with numbers? ...

Javascript to run after onLoad but before anything else to set defaults

Hey guys, So I have an .aspx page loading up and populating drop downs based on a lookup table in the database. What we want is for the user to be able to configure which of these values comes defaulted by specifying that value in a drop down somewhere else in the app. Now, it's easy to default the "first" value, or something like that...

How to use the Insert Key (like in traditional windows) for a WPF 4 App?

Ok, I know that the new versions of windows do not use the insert key by default and you have to program for it. I want to be able to type in my text box and override the content that is in it just like in old windows when you could activate the insert key. This is just for my WPF 4, VB.net Application. Updated Information: That what I...

Accessing objects from other classes in ASP.NET (VB)

Please forgive the newb question. I am very new to .NET so don't assume I've done something basic. In ASP.NET I have a form that has a Textbox named txtOutput and a button. In the main file.aspx.vb I can call a function from the button handler and in that function I can have txtOutput.Text = "Some Message" with no problem. I have ...

How can I delete specific record from mshflexgrid?

How can I delete specific record from mshflexgrid? For example mshflex grid is showing data from monthly_instal table. Now I want to delete record from this table. I have written code to delete record from that table but its deleting record one by one like 1 2 3 4. I want to delect specific record whatever it is 3 or 4 or 2 or 1. Even I ...

NetUserGetInfo/NetLocalGroupGetInfo returning error 1722

I have the following code (VB.NET) which is designed to determine if a given account name refers to a local group or a user account. This will only be called for accounts/groups on a machine, not a domain. Module netapi Private Declare Function NetUserGetInfo Lib "Netapi32.dll" ( _ ByVal ServerName As String, _ By...

An item with the same key has already been added - csvreader.fieldcount

Hi, I'm trying to create an import program from CSV. My code is csv = New CsvReader(New StreamReader("CSVFileLocation"), True) Dim fieldCount As Integer = csv.FieldCount The error message "An item with the same key has already been added." on the second line. If I changed "HasReaders" to "False", there's no such error. But, I'm not ...

Visual Studio 2008 to 2010 'fieldName' is not a member of ...

I created a new project. I copied files from the original VS 2008 project into the new VS 2010 an used "include" in VS 2010. I get an error saying "Error 108 Maximum number of errors has been exceeded." It seems that EVERY field in the webforms\user-controls\ASCX's has the error message "fieldName' is not a member of". I tried a dele...

How do I use the "Handles" clause from Visual Basic .NET with a DLL written using C#?

In a Visual Basic .NET application, is there a way to use Handles on an object referenced in a DLL written in C#? Compiling the code gives me the error: 'Handles' in modules must specify a 'WithEvents' variable qualified with a single identifier. I'm writing the Visual Basic .NET application, but I do have the source code of th...