vb.net

Upload and Download files from and to mainframe in VB.net

How do I upload and download files from and to Mainframe dataset using VB.net I have all the FTP details to the mainframe dataset. ...

ICSharpEditor and Accidental Hotkeys

I seem to have a bit of a problem with the ICShartEditor text editor. It works fine for me in a Windows Forms app, except that if I have a button (or any other control) on the same form that defines a hotkey (like ALT-S for a Save button), then whenever I try to type 'S' in the text editor (or whatever the hotkey might be), then it trigg...

DateTimePicker updates the value a bit too early

I'm using a DateTimePicker (.net). Is there a way to update the value only when the calendar closes? Or is there a way to know when the calendar open/closes? The DateTimePicker is bound to an object and this object check the dates and pop a message box when needed. When the user is browsing for a date, the message box appears. I only w...

Iterate through Custom Object's Property Names and Values

I'm trying to create an export Excel/CSV function that will iterate through a custom object and first output the property names and then output the values. I want to use reflection only where necessary so I'm attempting to save the property names when I output the headers and then reuse them to print the values. Is this possible? I'm ...

Are globals still bad?

I ran across some code like this today; having a flow control flag that is visible to the whole class. My gut says this is the wrong way to handle this need for flow control (it's almost like an old time global flag in C). (The example is in VB.Net but similar things could be done in C#.) Public Class myClass Private bMyFlag As Bo...

Absolute value in vb.net

How do you get the absolute value of a number in vb.net? Is there a function built in? I know I can simply code a function myself, but I want to know if there is one already there first. It seems so simple, I could probably make it in three lines, so I would be surprised if there isnt one.... Thanks! ...

Sending email to all the email adresses in gridview which are checked

Hi, I have a grid view control in my application. Please see the below code. <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="CPUserID" DataSourceID="GetSelectDelegatesDataSource"> <Columns> <asp:BoundField HeaderStyle-CssClass="gridview_header" HeaderStyle-Fo...

How do I get the current state of Num Lock in VB.NET?

How do I get the current state of Num Lock in VB.NET? ...

SubSonic 3 VS SubSonic 2 Genrating Code flexibility ?

Hi, How can i reach same flexibility with Generated clases in SubSonic 3 as i had in subsonic 2. Main needs: -Select wich tables include or exclude. -geneeated files Target. thanks, TheGodfather ...

Writting data into a text file at particular position

I have a text file containing the data in following format 12345 Abdt3 hy45d et45a 76huj agsj7 Now I want to replace hy45d with another sting that is created on run time. But I am not finding any way to do it. It keep replacing the firt item or append it in next line. Can any one plz help me resolve this issue Code that I am using i...

A bunch of logged exceptions in Microsoft.VisualBasic.dll

I have a large project where we have 2-3 dll projects that are converted from VB6 to VB.NET. We have fixed all the issues that caused compilation errors, and most of obvious issues in running, so now we have basically a program up and running. The exe is created from scratch in VB.NET, using a lot of functionality from the converted dll'...

Excel is saving in C:\\MyDocuments Defaultly

Hi I am exporting data to excel and try to save to a folder which is in my application...but the excel is saving defaultly in C:\Documents but i wanted to save in E:\Apllication\Reports Here is my code to generate excel sheet If ComDset.Tables(0).Rows.Count > 0 Then Try With Excel .SheetsInNew...

Update primary key value using entity framework

I'm trying to update one value of a compound primary key from within the entity framework and I'm getting this error: "The property 'CustomerID' is part of the object's key information and cannot be modified. " Here is my code: Dim customer As Customer = (From c In db.Customer Where c.CustomerID = "xxx" AndAlso c.SiteKey = siteKey).Fi...

How to show a custom 404 page in ASP.NET without redirect?

When a request is 404 in ASP.NET on IIS 7 i want a custom error page to be displayed. The URL in the address bar should not change, so no redirect. How can i do this? ...

IntelliSense in VB Xml literals

Hi, is there a way to enable IntelliSense for XML literals in VB9 (VS 2008)? The ideal source of IntelliSense is an XSD document, but I can use anything else format to do it. Thanks ...

Odd behaviour with generic Constraints on an Extension method

I must be doing something wrong here (because really, what are the chances of me tripping over another bug in the Vb.net compiler?) I have a static generic function in .net 2.0 Vb code, I thought it was time to "upgrade" it to be an extension method, but the compiler complains with Extension method 'AddIfUnqiue' has type constrai...

What is the Vb.net version of (c#)Cast?

How do I convert the following line into VB.net?? FtpWebRequest uploadRequest =(FtpWebRequest)WebRequest.Create("example.com" + @"/" + "localfile.html"); Thanks in advance ...

The remote server returned an error: (501) Syntax error in parameters or arguments

Hello, I am trying to upload a file to Mainframe machine from my VB.net application. I am getting the following error. The remote server returned an error: (501) Syntax error in parameters or arguments Below is my code. Any help will be appreciated. Dim urlHost As String = "ftp://" + FWFTP.Default.TargetFTPHost.ToString() Dim url ...

Convert these lines from C# to VB.Net?

Hi, I'm wondering how this can be converted to VB.NET. private void RaiseStreamVolumeNotification() { if (StreamVolume != null) { StreamVolume(this, new StreamVolumeEventArgs() { MaxSampleValues = (float[])maxSamples.Clone() }); } } public class StreamVolumeEventArgs : EventArgs { public...

FTPWebRequest Site values

Hi, How do you set Site values in FTPWebRequest in VB.net In Chilkat we set values like below Dim ftp As New Chilkat.Ftp2() Dim success As Boolean success = ftp.Site("lrecl=1000 recfm=fb cy pri=1 sec=1") ...