vb.net

Detecting if Internet is connected

Hi, How can I check through my application if computer is connected with internet or not (at the moment) I need a message if net is connected. Thanks a lot Furqan ...

Better way to retry a statement that threw an exception in vb.net

I usually do something like this: Dim Attempts = 0 Try Retry: <Block> Catch If Attempts < 3 Then Attempts += 1 Thread.Sleep(2000) GoTo Retry Else Throw End If End Try This is really bad looking for me, but i don't know of a better way of do...

Unable to get namespace System.Deployment.Application

I am trying to get this: System.Deployment.Application.ApplicationDeployment.CurrentDeployment.IsFirstRun But the application namespace is not there. I just see System.Deployment.Internal. The object browser, however, shows me all the properties and methods of that namespace, but my app can't see it. What am I missing? ...

Change datasource for Dataset

Hello, May I ask a question. I have a vb.net window application project that connect to Access database. I use dataset for all Forms and Reports. Now I would like to change back end from Access database to SQL Server 2000 database. I change the connection string(Data source, Data Provider etc)to connect to SQL Server 2000. But it i...

NotifyIcon.BalloonTipClicked event and mouse buttons

I've got a NotifyIcon that signals downloadable application updates. I want the download page to open on a Left Click on the NotifyIcon and on a Left Click on the NotifyIcon balloon (on screen for 10 seconds). However, when I handle the BalloonTipClicked event I can't figure out if it was a Left or a Right click. Thus, while the balloon...

Is there #Region code for HTML

In VB and C# there are #Region ... #endRegion and have it collapsable. Is there a similar way to do this in HTML? Right now I just have comments blocking where the different elements are on my HTML page, but I would like to have a single collapse point instead of all of the <tr> <td> and <div> tags collapsed. ...

VB.net program dataadapter connection closes after fill, but database still shows connection

After running the following sub (VS debugger), I try to detach the database in SSMS, but it shows the connection open still and won't let me detach. If I close program in debugger, the database shows no connections. I check the dataadapter's connection in the finally block and is shows closed. What gives Private Function ClientMasterDBF...

How to convert this C# code to Visual basic

Im not sure how to convert C# code with delegate into Visual basic code, can you help me? List<XmlUser> matchingUsers = this.Store.Users.FindAll(delegate(XmlUser user) { return user.Email.Equals(emailToMatch, StringComparison.OrdinalIgnoreCase); } ); ...

How to open a file in an active workbook? VB.NET 2008

I have a program that filters data and then outputs it to a tabg delimited file. I then use Excel Interop to open this file in Excel because directly outputting to a worksheet takes too long. So currently I am using this code: AD.DF.WriteToFile(vbTab) Dim WB As Workbook = ExcelApp.Workbooks.Open(AD.DF.DatafileInfo.WriteToFileLoc...

String obfuscation and function names

Can I change the following code and safely obfuscate it ? or that I must exclude it from obfuscating (e.g. stackoverflow 2555355 obfuscating-asp-net-dll / 2555497#2555497 ) Dim fontNames As New ArrayList . . . Me.myCtrlCmbFontName.DataSource = fontNames Me.myCtrlCmbFontName.DisplayMember = "mcpGetName" ' <- Here I get a warning Pub...

VB.NET combobox persistence?

I'm fairly new to VB.NET, and I've mainly been doing ASP programming up 'til now, and I have a pretty simple question. I'm creating a program that will copy a selected file to a selected directory, and I want to store recent files/dirs so that they can be selected from a combo box. I was planning to just create a settings with "files" a...

[VB.Net] Using System.IO namespace for FTP operations

Hi! I have a few syncing routines that I'd like to use for FTP uploads. However they all use the functions in the IO namespace, and I was wondering whether I could use it to access distant files stored on an FTP server. Maybe should I mount the distant server as a network drive? Is there a way to do this programatically? Thanks, CFP. ...

LINQ to SQL join 3 tables and select multiple columns and also using Sum

Hi, I have three tables Student, TimeSheet and TimeRecord. Talbe columns: Student : StudentId, FirstName, LastName TimeSheet: TimeSheetId,StudentId, IsActive TimeRecord: TimeRecordId,TimeSheetId, BonusHour(type int), CreationDate Table relationship: Student 1:N TimeSheet (FK StudentId) TimeSheet 1:N TimeRecord (FK TimeSheetId) ...

SFTP using VB.NET 1.1

Hi one of the task assigned to me is convert the FTP Application to SFTP using VB.NET 1.1. I am looking the on the internet but I am not getting any free/open source API which support this. Is anybody know about this? if yes could you please share the code? Thanks Jwalin ...

WPF rotate need to cast transformedbitmap to bitmapimage

I have a rotate function that I rotate the image from a button. When I hit the rotate button again I cant because I am returning a transformedBitmap here is my function Public Function RotateImage90(ByVal OrigImage As BitmapImage) As TransformedBitmap ' Create Image element. Dim rotated90 As New Image() ...

TryCast fails where DirectCast works (.NET 4.0)

Hi, I find this behavior of TryCast in .NET 4.0 / VS 2010 rather confusing. In my understanding TryCast works like DirectCast, but will return Nothing instead of throwing an exception if a conversion is not possible. VS 2010 / .NET 4 ?TryCast(CType(1, Object), String) Nothing ?DirectCast(CType(1, Object), String) "1" VS 2008 / .NET...

Retrieving 2 SQL querry from one page to other using hyperlink GridView

Greetings everyone, I have a code to pass the querry from a one page that has a gridview hyperlink but what i didn't know is how to retrieve it.. Here is my code i hope you could help me fix this one.. thnx Have a nice day ^^, Default1.aspx(Gridview1) page: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="Fa...

.Net - Dispose correctly children object

From code analysis (Visual studio), I got this warning: Warning 2 CA2000 : Microsoft.Reliability : ... Call System.IDisposable.Dispose on object 'l' before all references to it are out of scope... So, I changed the code : Dim l As LiteralControl = New LiteralControl AddHandler l.DataBinding, AddressOf OnDataBinding container.Control...

Radgrid: If click on edit or cancel => redirect Radsplitter(radpane) to external

ello to everybody, I have a radgrid page in edit modus inside a radpane. When you click on the edit or cancel buton of the radgrid then it gets only reloaded inside the radpane. As the radpane is quite long, you don't see the buttons opn the top. Does somebody how I might catch the edit/cancel click inside the radpane in order to get th...

VB.NET Winforms menu item shortcuts overriding default shortcuts?

In a VB.NET Winforms application, I have a form that contains both a datagridview and a textbox. I have some menu item entries that have shortcuts of Ctrl-X, Ctrl-C, and Ctrl-V that operate on the datagridview. However, these override the default cut, copy, and paste shortcuts for the textbox. How can I make the menu shortcuts only ap...