vb.net

Addhandler is not firing off in rowdatabound

I am creating a dropdown list in code for a gridview. I want to create an addhandler so I can have access to the selectedvalue. However, here (Rowdatabound) the add handler does not get fired off. How should I go about this? Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEven...

ProcessStartInfo print verb does not exist for .tif images

We have a piece of software that attempts to print .tif images using a ProcessStartInfo object. It sets the Verb property to "print" and the FileName property to the path of the image. It then sets the UseShellExecute property to true and executes the Process.Start() method. However, nothing happens. I created a small test program to...

Populate DropdownList based upon other DropDownList VB

I have found a couple of examples on the internet to do this but really struggling to get it working in VB. (Tried a converter but had mixed results) I need the selection options of a Dropdownlist to be populated based upon the differing values in the first dropdown list. Can anyone help with a releativley simple example in VB? Not fus...

Hooking into Terminal Services Manager

Has anyone ever come across a way of a way to create an app that kind of mimics what Terminal Services manager does in Windows2003/XP. I would like to write something that would either go and query a farm of server every n secs a get me a list of users logged in, there process's etc or do maybe type a username in and it goes and finds t...

How do you insert an entity for a many-to-many relationship? (entity framework)

If I a many-to-many relationship between Users and Roles and I have an instance of a User entity and several Role Ids can I insert a relationship between the two types of entities without having any other Role data and without doing a select on the Roles first? Update: I might not have been clear enough. I don't have an instance of a ...

Getting requester's login in ASP.NET/VB.NET

Is there a way to get the logged in user from a vb.net web application? IE, if someone logged in as "foo"/"bar" on their local machine accesses the site, I need code to get me "foo"/"bar". This is for a passthrough on our intranet, where everyone uses the same Active Directory. Essentially, I need to harvest the username of the logge...

access mapped columns programmatically

I have both input as well as output collection for OLE DB Destination. However, the input and output columns are mapped in the OLE DB destination task and the column names do not match. Further, when you look at the "mappings" window of the task, there are certain columns in the input side, which are set to ignore. If i had to write th...

DllImport vs Declare in VB.NET

I notice in the MSDN documentation that there are multiple ways to declare a reference to a function in an external DLL from within a VB.NET program. The confusing thing is that MSDN claims that you can only use the DllImportAttribute class with Shared Function prototypes "in rare cases", but I couldn't find the explanation for this s...

Convert From Local Time to UTC (Given the local TimeZone)

I've dates in different time zones. How to convert them to UTC giving the respective time zone. Something like this: Dim Dated as DateTime = TempDate.ConvertToUniversalTime(TimeZone) ...

Converting Greek characters to Unicode

Is there any easy way of converting a windows-1252 string into a Unicode one? ...

Using ApplicationSettings to store Checked property for WinForms RadioButtons

I have a WinForms dialog box that contains 3 radio buttons. I am using ApplicationSettings to bind the Checked property of each of these RadioButton controls, but it doesn't do what I am expecting it to do. Now I have to click each radio button twice before it gets checked and the selected radio button is not being persisted. Is there a...

Getting the Foreign Key constraints of a table programatically

I'm trying to use a DataTable to get the schema of a SQL Server DB. But, when try to detect the ForeignKeys, the constraints collection only brings the UNIQUE constraints. Private Sub ShowConstraints(ByVal tableName As String) Dim table As DataTable = New DataTable(tableName) Using connection As SqlConnection = New SqlConnectio...

How to read each XML lines into specified strings?

Hi, I'm trying to create a VB.net application which reads each line from an XML-file (or ini file, doesn't matter) which dictates what the name of a string should be. E.g "string1 = xml.line1" "string2 = xml.line2" etc What would be the best approach of doing this? I've already pluckered a bit with Xml.XmlTextReader and it seems t...

what is a recommended way to assign CRLF hotkey to button

what is best way to assign CRLF hotkey to button? In delphi it can be set to default one, but how its done in VB ? ...

how to make a simple SQL query from VB.net (access db)

I have a working dataset and datagrid already in my project, but I want to make my own quicksearch button. The following code gives error for connectionstring PROVIDER KEYWORD NOT SUPPORTED connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\prod.mdb" sql = "Select (*) from table1 where prodid=" + searchfiel...

detect if NumLock is OFF and turn it always back ON

What is a method to detect if NumLock is OFF and how to turn it always back ON automatically when my VB APP is running ? EDIT: My app is dedicated app, running on dedicated computer with external numpad device. another option would be to ACCEPT NUMPAD ARROW KEYS (etc) and convert these to NUMBERS on fly, is it possible?? (e.g. ignor...

how to read ConnectionStrings

This is not working.. any ideas? ConfigurationManager.ConnectionStrings("YourConnectionString").ConnectionString Error "ConfigurationManager not declared" ...

how to make BindingNavigatorAddNewItem to ask primary key in a dialog?

how to make BindingNavigatorAddNewItem to ask primary key in a dialog while new row is created after button is clicked? currently its adding blank row to end of DATAGRIDVIEW that is a big confusing for end user , if user forgets to enter primary key exception occurs. ...

how to filter textbox input to numeric only

How to suppress all data except numeric, this is not working on KeyDown() If e.KeyData < Keys.D0 Or e.KeyData > Keys.D9 Then e.Handled = True End If ...

Issues with Asp.net administration tool

Hi, i have created a project in asp.net.now i want to implement asp.net administration tool in my project for user management.The tool works fine in a website ,but in a project it does not work. Actually i have used the follows links to do this:- http://msdn.microsoft.com/en-us/library/bb515342.aspx When i implemented this walkthrough...