vb.net

Is there anything you can do with a C# event that you cannot do with a VB Event?

My friend is primarily a VB developer and he says time and time again how much more simple it is to code events in VB than C#. My take on the issue is that it probably is easier but if there was not a reason for the added complexity, they probably would have made it just as simple in C#. Can anyone tell me if there is any added flexibili...

ClickOnce Deployment Errors

I am trying to deploy a ClickOnce app. It had worked previously when the server was just sitting with .Net 2.0 installed (no SP). Recently the server had 3.5SP1 installed on it and now ClickOnce is failing with the error: Value does not fall within the expected range inside System.Deployment. Here is the information posted on the MSDN ...

How To Report Progress Changed vb.net?

I need to report progress changed. Consider the following code: Public Class Calculator Public Event CalculationProgress (ByVal sender As Object, ByVal e As MyCalculationProgressEventArgs) Public Function Calculate(..).. ' Perform calculation here ... ' Reporting proggress Dim args As New MyCalculationProgressEventArgs(myobj, myValue)...

Adding a record to an access database, Where is the error in this code?

read a lot about DataAdapter, DataTable ,.. to reach to this code, in the Save Button: 'insert new row ds.Tables("Employees").Rows.Add(ENumTxt.Text, ENameTxt.Text, EPosTxt.Text, EAgeTxt.Text, ESalTxt.Text, EPhonTxt.Text, EAdrsTxt.Text) 'save changes ds.AcceptChanges() Try If ds.HasChanges Then Dim AffectedDS As DataSet = ds.Ge...

How do i get row keys / cell values & call a method when a row is selected in the standard .net 2.0 Gridview

I have standard .net 2.0 gridview control from which i want to get row keys or cell values from the grid when a row is selected. I also need to call a method each time a row is selected. Does anybody know How i can do this using ASP.net & VB? ...

VB Unreachable code error/warning

I've been mostly working with VB.Net for over a year and just noticed this Am I going insane, or does VB.Net NOT have an "Unreachable code" warning? The following compiles quite happily with nary a warning or error, even though there is a return between the two writeline calls. Sub Main() Console.WriteLine("Hello World") Retur...

How do I add blank rows to a repeater bound to a List<T>?

Is this possible? Using VB.NET. Can I do it in the footer maybe? Would that be the best way? Bind the footer to a datatable and throw some blank rows in there? ...

Convert code C# to VB - Function references

I have some C# code I'm trying to convert to VB.NET. There are some external dependencies I'm referencing in each project. The C# line is TWriteFileCommand writeFile = (TWriteFileCommand)CommunicationLink.CreateCommand(TOPKernel.TCommand.CommandType.WriteFile); I don't really understand what the TWriteFileCommand in parathesis after t...

Self referencing in Vb.Net

Hi, how can i get the type of of an object (with GetType) from within the object itself? Something like GetType(Me) (that, of course, doesn't work). Thanks. ...

How can I deploy a VB.Net 1.1 app with no manufacturer set

I need to deploy this app and currently the installer the path goes something like "C:\Program Files\Manufacturer\App". I just want it to be "C:\Program Files\App" by default. I know I can change this manufacturer from the properties for the project, but I want it to go away altogether. The setup project won't build with it gone. An...

Add XML Comment during serialize/deserialize with VB.NET

I have an XML document that I am deserializing (VB .NET 3.5 Framework), changing some values, and the serializing again. The original document has several XML Comments in it. When I go through all the deserialize/serialize all of the comments are lost. Is there a way to preserve the comments? If not, is there a way to add comments on...

How do you speed up CSV file process? (5 million or more records)

Hi, all. I wrote a VB.net console program to process CSV record that come in a text file. I'm using FileHelpers library along with MSFT Enterprise library 4. To read the record one at the time and insert into the database. It took about 3 - 4 hours to process 5+ million records on the text file. Is there anyway to speed up the proc...

Special Error Page in Asp.Net

Hi, i want to redirect to a special page which shows detailed error message for unexpected errors.Which solution is the best for it in asp.net?Can u give examples? Thanks ...

Error: System.Data.Linq.Binary' cannot be converted to '1-dimensional array of Byte'

I am trying to return a binary from the DB using linq for display in the browser. The method below using ado.net works but I am trying to ypgrade to linq but the linq version returned the error. Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Dim imageId As String = context.Request.QueryString("id") Dim r...

Date Format in .net

I am getting date as April,1,2009. I want to format the date so that the month is displayed as 4. Not only for the date given above but for whatever date is given. Can anybody give appropriate code? ...

How to handel exceptions with a SqlDataSource

Hi I have a SqlDataSource that is supplying data to my GridView. Thats all i am using on my form, thus i have NO code behind at all. But somewhere i need a TRY CATCH block just in case my connection get's lost. What code must i place where? If i get a error i want my lblMessage Text to be "No connection". Any help would be great! Reg...

Creating a function that uses a generic structure?

I am attempting to create a generic function that the students in my introductory VB .NET course can use to search a single dimension array of a structure. My structure and array look like this: Private Structure Survey Dim idInteger As Integer Dim membersInteger As Integer Dim incomeInteger As Integer Dim stateStrin...

How to get date part from datetime?

Duplicate: How to truncate a date in .net? I have datetime field containing '4/1/2009 8:00:00AM'. I want to get '4/1/2009' without the time. ...

Active/Crystal Reports & The End-User Designers

I've been doing research on reporting suites for a project my company is about to undertake, and have narrowed the candidates down to Active Reports and Crystal Reports. During the demo yesterday, it was clarified to me that one of the capabilities our client would like is the ability for the end-user to create custom reports integrat...

Multiline strings in VB.NET

Hi to all. Is there a way to have multiline strings in VB.NET like python a = """ multi line string """ or php $a = <<<END multi line string END; ? Of course something that is not "multi" & _ "line Thanks ...