vb.net

how to encode a datetime in a QueryString and read it in the asp:QueryStringParameter

How to encode a datetime in a QueryString and read it in the asp:QueryStringParameter out: (it's a asp:HyperLink NavigateUrl ) String.Format("~/Reports/Logs/Option_History.aspx?OptionID={0}&time={1}", id, time) in: <asp:QueryStringParameter Name="time" QueryStringField="Time" Type="DateTime" ConvertEmptyStringToNull="true" /> ...

Strange behaviour when appying a ColorMatrix to an image in .Net, WinForms.

The method below, takes a colour matrix and applies it to the supplied image. There are a couple of things to note: (1) It is not a function (2) The same image is used to create the graphics object, and as the source of the DrawImage method. Public Sub ApplyMatrixToImage(ByVal matrix As ColorMatrix, ByVal image As Image) Using atts...

Understanding AddHandler and pass delegates and events.

I am using AddHandler to wire a function to a control's event that I dynamically create: Public Delegate Sub MyEventHandlerDelegate(ByVal sender As Object, ByVal e As System.EventArgs) Public Sub BuildControl(EventHandler as System.Delegate) dim objMyButton as new button AddHandler objMyButton.Click, EventHandler ...

Check if a Windows application is installed on local machine from Asp.net?

We have a certain application installed on a single machine. I would like to enable/disable a button based on the existence of this application. Is there a way to check for its existence from asp.net? the app is currently on an XP machine, but want to code for Win7 as well. VS2008 3.51. Asp.net ...

N-Tier Architecture - Structure with multiple projects in VB.NET

I would like some advice on the best approach to use in the following situation... I will have a Windows Application and a Web Application (presentation layers), these will both access a common business layer. The business layer will look at a configuration file to find the name of the dll (data layer) which it will create a reference t...

Different behavior between IE6 and Firefox for HTML Tables?

I'm doing the first bit of web-page development I've done in years, in VS2008, using VB.net. I have a fairly simple layout, which is using several nested tables. IE6 displays the layout just fine, but Firefox for some reason shows the whole thing in a small panel at the top of the page, with a scrollbar. Can anyone suggest something basi...

How to highlight a button that is clicked in vb.net

Highlight, just like when you hover over to the button, its being highlighted. But how do you retain the highlight when you have clicked the button? ...

Database not updating after UPDATE SQL statement in ASP.net

I currently have a problem attepting to update a record within my database. I have a webpage that displays in text boxes a users details, these details are taken from the session upon login. The aim is to update the details when the user overwrites the current text in the text boxes. I have a function that runs when the user clicks the ...

Read from multiple tables in vb.net data reader

I'm trying to read from two tables in mysql: Dim sqlcom As MySqlCommand = New MySqlCommand("Select * from mother, father where IDNO= '" & TextBox14.Text & "' ", sqlcon) -But I get this error: Column 'IDNO' in where clause is ambiguous Here is the whole code: Dim NoAcc As String Dim NoAccmod2 As String Dim NoPas A...

VB - Convert Web Site to Web Application

Hi This is my first time doing VB :-) I've inherited a web site, which I've converted into a web application in VS2008. The conversion has worked for everything except a Gallery control. The compile error I'm getting is: Type 'Gallery' is not defined in file: gallery_oct07.aspx.designer.vb Option Strict On Option Explicit On Par...

Pattern for managing reference count and object life

We have a serial port which is connected to hundreds of physical devices on the same wire. We have protocols like Modbus and Hart to handle the request and response between the application and devices. The question is related to managing the reference count of the channel. When no device is using the channel, the channel should be closed...

VB.NET Folder location

Hello, My program uses some external programs that i included in the Files folder. In my code im reffering to Files/external_program.exe Windows Vista & Windows 7 knows how to handle this and starts the program on the same location as my program in the Files folder. But Xp doesnt know where it is, and Windows XP will think im refferin...

DataGridView formatting

I have a DGV with columns "code" and "name". Depends of lenght of a code I want to add tabulation to the "name" cells, to show structure of a data. Like that in this picture: How is it better to do? I think there is a better way then just loop for all rows and add spaces in front of names, right? ...

FB Connect: (417) Expectation failed

Hi, I developed a simple ASP.NET app, it was working fine, but now I can't get user info; I am getting this message: The remote server returned an error: (417) Expectation failed. and here's the code I'm using: Dim FBUser As Facebook.Schema.user = Nothing Dim connectSession As Facebook.Session.ConnectSession Dim FBApi As Api con...

How to extract the 256x256 icon from an icon and display it in .Net, Winforms, XP

Here's the code that I use to extract the icon size that I want: Dim i As Icon = My.Resources.Spectrum Using i2 As New Icon(i, New Size(256, 256)) Me.PictureBox1.Image = i2.ToBitmap End Using This works from 16x16 up to 128x128 but for 256x256 it extracts the 128x128 icon. I tried 0x0, because I seem to remember th...

having trouble disabling textbox in vb.net

How do I disable a textbox the second time? here is my code, In form load the textbox is disabled, unless the user will input an idnumber that is in the database. But what if the user will input an idnumber that is in the database then, input again another that is not, That is where this code comes in, but it has problems, it doesnt disa...

How to know what tab is selected in tab control in vb.net

I have this program that should execute a piece of code base on the tab that is selected. How do I do it? I've tried: if tabcontrol1.tabcount=1 then 'Execute this code' else if tabcontrol1.tabcount=2 then 'execute this code end if -But doesn't work, what's the proper way of doing it? ...

WebBrowser.Print() wait until complete. .NET

I am using a WebBrowser control in VB.NET and calling the Print() method. I am printing out using a PDF printer and when Print() is called it is not immediately kicked off (it waits until it has completed running code for the entire Sub or block. I need to make sure the file I am printing too is complete and continue process with this ...

How to insert a DataTable with existing Key to a SQL Server Table.

I am working with VB.NET.. i have a DataTable called "QUESTION", containing 3 fields: QuestionNumber (unique integer key) QuestionText QuestionType In my SQL Server database I created a Table called "QUESTION" with the same fields. QuestionNumber is defined as integer unique key, auto increment Now, when i make a bulk copy to inser...

Linq to object - Select Distinct

Hi, I can't quite figure out why this Linq Statement isn't working as i would expect: Dim distinctSurchargesList = (From thisparent As Parent In ThisParentCollection _ From thisChild As Child In thisparent.theseChildren _ Select New With {.childId = thischild....