vb.net

POST variables to web server?

Hello I've been trying several things from Google to POST data to a web server, but none of them work: I'm still stuck at how to convert the variables into the request, considering that the second variable is an SQL query so it has spaces. Does someone know the correct way to use a WebClient to POST data? I'd rather use WebClient becau...

How do I subscribe to a MSMQ queue but only "peek" the message in .Net?

We have a MSMQ Queue setup that receives messages and is processed by an application. We'd like to have another process subscribe to the Queue and just read the message and log it's contents. I have this in place already, the problem is it's constantly peeking the queue. CPU on the server when this is running is around 40%. The mqsvc.e...

List of Input Values which will cause the "A potentially dangerous Request.Form value was detected..." error

I know the < and > characters will cause this error, but what other characters/inputs will cause this error? I'm testing for this error in the Global.asax, and reridrecting to an error page where I want to list all possible values which cause this error, so the user can go back to their page and get rid of them. I've done some googling...

How can I process a form's events in another class / module automatically in VB.NET

Here's my code: Public Class Form1 End Class Public Class Form1Handler Inherits Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("I") End Sub End Class I'm trying to get Form1Handler to process Form1's events automatically. How can I do this?...

add on click event to picturebox vb.net

I have a flowLayoutPanel which I am programatically adding new panelLayouts to. Each panelLayout has a pictureBox within it. It's all working nicely, but I need to detect when that picture box is clicked on. How do I add an event to the picture? I seem to only be able to find c# examples.... my code to add the image is as follows... ...

why does vb.net not support multiple inheritance?

I've seen some discussion on why c# does not implement multiple inheritance but very little as to why it isn't supported in vb. I understand that both c# and vb are compiled down to intermediary language and so they both need to share similar restrictions. The lack of multiple inheritance in VB seems to have been given as one reason fo...

ListView wont release focus in .NET CF 3.5

I have a form with a ComboBox and a ListView, when I press the down key on the Dpad focus moves from ComboBox to the items in the listView. But then I cant get out of the ListView and focus on the ComboBox again, I can only go up and down in the ListView items, how do I let the user go back to the ComboBox? ...

Windows 7 catch sleep/suspend messages

I'm wondering if it's possible to catch Windows 7 Sleep/Suspend Messages. http://stackoverflow.com/questions/727154/cant-catch-sleep-suspend-messages-winxp ...

What's the reason both Image and Bitmap classes don't implement a custom equality/hashcode logic?

From MSDN documentation, it seems as both GetHashCode() and Equals() haven't been overriden in Bitmap. Neither have them been overriden in Image. So both classes are using the Object's version of them just compares references. I wasn't too convinced so I decided to fire up Reflector to check it out. It seems MSDN is correct in that matte...

Simplify CASE in VB.net code

Hey all, i am looking here to see if anyone would have a better way to acomplish this task below in less code. Select Case mainMenu.theNumOpened Case 1 Me.Text = "NBMsg1" Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 302, 5) Case 2 Me.Text = "NBMsg2" ...

opening transaction validation in vb.net

Can anyone help me on how can I validate transaction example: transaction = mySqlConn.BeginTransaction(IsolationLevel.ReadCommitted) If there's still an opened transaction, then the code above will ignore.. How do I know if there was a transaction not yet committed before opening new transaction to avoid Nested Transaction? ...

CA1034: Nested types should not be visible

Here's an explanation of the rule that that I am trying to understand. Here's the simplified code that the Code Analyzer was complaining about: Public Class CustomerSpeed Public Enum ProfitTypeEnum As Integer NotSpecified = 0 FlatAmount = 1 PercentOfProfit = 2 End Enum Private _ProfitTypeEnum As Pro...

Any Addin for Visual Studio 2008 which would sort the imports?

I have seen plugins for VS 2005 and also for C# environment in VS2008 but not able to find for VB.NET environment in VS 2008.I want it to sort for each file, is there any addin for this? ...

How to convert RGB value to color name in Silverlight 4.0?

The code : Dim myColor As Color = Colors.Red Dim colorName As String = myColor.ToString() Results in : #FFFF0000 when printing colorName to screen. Is it possible to get the color name in Silverlight without making a select case on the RGB values? ...

can we convert flv to mp4 directly from internet using ffmpeg

VB.Net This works fine for me "-i ""C:\myfile.flv"" -ar 22050 FileName.mp4" but can i use this one i.e. "-i ""http://www.example.com/myfile.flv"" -ar 22050 FileName.mp4" ...

Strange DataTable behaviour

There´s a strange behaviour in my code which I can´t explain... I have worked arround it but I´d like to know the reason of this behaviour. My Code: If dataset.Tables.Count > 0 Then Dim rows() As DataRow = dataset.Tables(0).Select("FileID = " + fileid.ToString) For Each row As DataRow In rows... the one and on...

Getting TexBox's ID's .... to Calculate

i have : vb code: Private Sub Calculation() Dim txt1 As Decimal txt1 = (CS_Incoms_done.Text / CS_Incoms_target.Text) * 100 CS_Incom_Result.Text = "%" + FormatNumber(txt, 2, TriState.False) Dim txt2 As Decimal txt2 = (CS_GovernmentService_done.Text / CS_GovernmentService_target....

Get UNC Path for Mapped Drive VB.net

I neet to get UNC path from mapped drive. I tried to use WNetGetConnection, but it doesn't work for me. It returns error 487. Does anybody know how to deal with this error or any other way to get the UNC path? ...

Dropping Sql Temp tables from Vb.Net

Hi guys, I have a vb.net app , and I am creating and dropping temp tables. I just want to know whether the temp tables created programatically from some client app will get dropped automatically with dispose of application or we should have to drop it explicitly by code. I need to be sure that all tables will get dropped when I close m...

WinForms binding

I have some controls bound to a BindingSource control. I want to do a calculation when the value changes in one control and set the result on another control. Do i update the textbox the property is bound to or do i update the underlying entity which would update the control anyway(i hope)? When i change comboboxA(onpropertychange).....