vb.net

Can I reference a dll programatically in VB.net? Or change the Local Copy path for a dll reference?

Can I reference a dll programatically in VB.net? Or change the Local Copy path for a dll reference? ...

Download file over HTTPS using .NET (dotnet)

I would like to download a file using VB.NET (preferably) or C# via HTTPS. I have this code to download a file over plain HTTP: Dim client As WebClient = New WebClient() Dim wp As WebProxy = New WebProxy("[IP number of our proxy server]", [port number of our proxy server]) wp.Credentials = CredentialCache.DefaultCredentials client.Prox...

VBx Language, What is this?

In Ironpython site exists references to a language called VBx using DLR. But i can't find any reference to this in google. Where is it? Edit: Is a Implement of Visual Basic 6.0 in DLR? if yes is so cool. Is more expected for people using VB6 yet and can't migrate because big frameworks. ...

How to manually populate the datagrid in asp.net 1.1 using vb.net 2003?

Hello, just would like to ask if it is possible to manually populate the datagrid in asp.net 2003 using vb.net we usually populate the datagrid using this code, in this code what it does is it populate the datagrid base on your query , it's automated you can't edit or evaluate the data inside. dataGrid.DataSource = ds dataGrid.DataBind...

Changing font properties to alter the spacing between characters in a string?

Does anyone know how i am able (if possible) to change the character spacing of a string or textbox output? One possibility is by creating a custom font, but i am unsure if there is a property in one of the overloads that will allow me to change character spacing?! Any response would be great, thanks in advance guys! ...

Attempted to perform an unauthorized operation

Now I use the following code: Public Function SetACL(ByVal filename As String, ByVal account As String, ByVal sender As Object, ByVal e As System.EventArgs) As Boolean Try Dim rule As FileSystemAccessRule = New FileSystemAccessRule(account, FileSystemRights.Write, AccessControlType.Allow) Dim fp As Pe...

Read key/value pairs in HttpWebResponse

Hi there, I want to read a string that looks exactly like this: VPSProtocol=2.22 Status=OK StatusDetail=0000 : The Authorisation was Successful. VPSTxId={BBF09A43-913E-14E3-B41B-E5464B6FF8A9} SecurityKey=EH8VFZUSH9 TxAuthNo=4979698 AVSCV2=SECURITY CODE MATCH ONLY AddressResult=NOTMATCHED PostCodeResult=NOTMATCHED CV2Result=MATCHED CAVV...

Web service do not return current Windows user name

This is the function that I use in web service for getting current windows user. <WebMethod()> _ Function User() As String Dim p() As String = Split(My.User.Name, "\") Dim p1 As String = p(1) Return p1 End Function When I run service on localhost it realy return current windows user name! The problem is ...

rounding to the best unit without losing precision

I receive a decimal number with a maximum of 4 digits after the "." and I know this number is in milligram. I have to find the best matching unit (milligram, gram, kilogram) for the number. for an example if I receive edited 116000000.0000 milligram, it's going to return 116.0000 kilogram 66990000.0000 milligram, it's going to r...

What are good problems to solve using CLR stored procs?

I have used CLR stores procedures in SQL server for awhile now, but I'm still wondering what the best situations to use them are. MSDN provides some guidelines for use like heavy string manipulation (regex), or replacing T-SQL that declares lots of table variables and cursors. I'm curious to know what problems SO users are solving with...

Cookie being deleted unexpectedly by the application

I am having an issue with a cookie that keeps getting deleted by the application. When you go into the application, if the cookie does not exist, it gets created. This works fine and everything in the cookie is stored correctly. When I click on a link to go to another page, once everything loads completely, the cookie gets deleted from...

What mistake am I making when creating a constraint in generics?

In asp.net 2.0 I have several "dropdowns" defined using generics (examples eye color, hair color, etc). The fields are all typical; id, text, etc. All are defined as their own classes which must implement an interface I created called ILookup. However, when I try to return a List<> of this class using: ddlEyeColor.DataSource = luMgt.Get...

Overloading Operators in C++, exporting and Importing then in VB.NET

Howdy all, I have a weird situation. I have a C++ code that overloads the +,-,* operators and exports them in a .DLL file. Now, I want to import those overloaded operators from within VB.NET code. So it should be like this: <DllImport("StructDLL.dll")> Public Shared Function Operator +(ByVal a1 As A, ByVal a2 As A) As A End Function ...

How can I write to the console from Excel vba code?

Is there any way to print a message to the console from an Excel vba macro? I have a small VB .NET console application that calls an excel macro, and I'd like the error messages from the macro code to print to the console. Debug.print doesn't help as it only prints to the immediate window. Any ideas? ...

Subroutine to connect to MS Access database

I have this subroutine setup to connect to a MS Access database: Public Sub MakeDBConnection(ByVal source As String) Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & source & ";") cn.Open() Catch e As Exception ReportError("CRITICAL", e.Message) End Try End Sub It is i...

aspx vb.net checkboxlist to be populated from sql server

can you populate checkboxlist from sql server query like a dropdownlist? with autopostback=true? i am using vb.net and have 50 checkboxes that shall show up from the database data depending on the selected value of the previous dropdownlist. also can i change the label of the checkbox each time the value is from DB? the label shall be sa...

using my own config file in my application

As a practice exercise at my college we have to make a simple room booking system, complete with its own config file. We're not allowed to use the one built into VB.NET (the professor wants us to adapt to not relying on things like that) so I've made my own. This is a sample: // Config file. // First column is the variable name that wil...

Grid based puzzle board game block removal algorithm

I have a "samegame" grid represented by a 1D array of integers. 0 to 63 to represent an 8x8 grid. the rules are that same coloured blocks of two or more can be removed by clicking on them. blocks then slide down from above. if a column is empty columns other columns move in from the sides. when someone clicks on the green blocks in t...

VB.NET - Form Placement

Hello everybody, I am making a program in vb.net (visual basic) that has two forms. I have one as a sort of "main" base which will be behind everything. Then I have another additional form which is suppose to go on top of the "main" form. Well I get this to work when I show both of the forms, but I want the smaller (additional) form to ...

Why is compiler not seeing my generic constraint?

ASP.NET 2.0; I am attempting to pass a custom type to a generic list to get a list of whatever type I send in. However I keep getting this error: Type argument '' does not inherit from or implement the constraint type '' What's confusing about this is I AM implementing the constraint. In fact, here is the Interface: Public Interface I...