In a vb script program, I have the following code objCommand.Properties("Page Size") = 9999..I have converted most of the vb code over, but this statement gives me a "Property Item is ReadOnly" error. How can I rewrite this line to work in vb.net?
I have this piece of code which is calling some functions in a web service. however the original was written in VB and when I have converted it it gives me an error in my c# stating that 'The name Information does not exist in the current context' I have checked the VB and it win there either!
i have to convert a visual basic 6 program to the visual basic 2008. i used the wizard that is provided to upgrade but that just doesn't work. It comes up with many errors. most of them are End of statement expected and Number of indexes exceeds the number of dimensions of the indexed array. I really don't know what to do with them and i have to fix them in order for it to run.
I was directed to update an old VB6 dll to VB .net as we are moving away from COM objects. The dll contains one function that does a bunch of high math calculations. I opened up a new class project in VS 2005, Imported System.Math, and then basically copied the function code from the VB6 project into the new class. When compiling, I made the assemble COM-Visible and also checked the Register for COM Interop in the project properties. I then copied the dll and tlb files to Windows/system32 and tried to register using Regasm.exe.
Even though I'm using the correct version for .Net 2, I still get error RegAsm : error RA0000 : Failed to load 'C:WINDOWSsystem32eagetairmiles.dll' because it is not a valid .NET assembly. When attempting to add a reference to it in my new .Net project, I see it in the COM tab - but in the location it was developed in, and I receive the following error: Converting the type library to a .Net assembly failed. Type library mydllname was exported from a CLR assembly and cannot be re-imported as a CLR assembly.
I am converting C# program to VB. I heard that "Yield" statement is ready from Visual Studio 2010 SP1.
[URL]
I updated my developing environment to Visual Studio 2010 SP1. However IDE still displays error to the following code saying that "yield" is not delclared.
Public Class WeakCollection(Of T)
Implements IEnumerable(Of T)...
ReadOnly innerList As List(Of WeakReference) = New List(Of WeakReference)()
[URL]..From the above link,i studied about the conversion.But i have a confusion:Whats the difference between the following two?CInt(myString) VB Only. This function converts the expression to an integer. A run-time exception is generated if the conversion fails.
Convert.ToInt32(myString) This function converts the expression to an integer. A run-time exception is generated if the conversion fails.
When should i use the first one and when to use the second one?
i have the following setup What i am trying to do is, when the user clicks on the 'calculate age ' button it must calculate the age and display the result based upon the selection in the combobox i.e if 'Days' are selected then it must display in days, if weeks are selected then it must display in weeks..etc
Similarly when the user clicks on the 'convert to date' button , it must subtract the given days(or weeks or months or years) from Todays date and set it to the maskedbox
I'm having an issue with my base conversion program. It seems to have a problem converting from base36 to base10 properly. After debugging all night, I've found that it's one certain function that's not working properly. The function seems to convert every last test number correctly, until I start getting into 11-digit numbers in base36. I have the max digits allowable for base36 set to 12 (so as not to exceed the base10 18-quintillion or so that an unsigned long can hold). I'm starting to think the issue is with VB and not with my code.The function as I've written it is below (DIGITS is a global const string ="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", and itr is a global integer used throughout the code for iteration):
'----------------- Public Function FromBase10(ByVal iValue As ULong, ByVal cBase As ULong) As String Dim remaining As ULong = iValue
I have a form which accepts the time ( start time and end time)in a text box. What i want to do is to convert it into time and get the difference of it. I googled it and found lot of question regarding converting to date and time. but i only need "time" and dont want date.
how to convert system.string to char for label text?? Here it my
[Code].....
I need to get the strings from the site and input the fields strings in the label text, so I needs to convert char of system.string but i don't know how to fix it.
I want my combobox when I type letter all item has the letter I have type will show in the combobox.... because in the current situation in vb .net when I type "A" all item that start from a will display I want this time when i a letter "A" all those have the letter "A" will display..
Dim SQLData As New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("FixedLineProvisioningConnectionString").ToString()) Dim cmdSelect As New System.Data.SqlClient.SqlCommand("INSERT INTO tblTotalComms_custinfo SET nt_username=@nt_username; SELECT @ID=SCOPE_IDENTITY()", SQLData) [Code] ..... I want to return the value @ID from the insert statement.
I have trouble with my vb application.I create query in dataset like this :Select * from Trans where year(dateTrans)=2009 and month(dateTrans)=5But is not work and error message : year and month function not identified, what is the problem ? what a sql date function ?If i create databound from dataset and drag n drop date field in form with datetimepicker control, if i had update dataset, date field is empty.Whats wrong with datetimepicket databound.
I need some help working with an OleDbCommand Statement existing statement
OleDb.OleDbCommand("Select *, (([AddressDisplay])&', '&([City])) AS Address
The City is stored in database with the city name and an additional abbreviation added. I need to get rid of the abbreviation, if possible.I DONT control the database its from a 3rd party.
Example: Houston[HST] I need to remove the [HST]
Can this be done? Either in the command statement of perhaps in the displaymember of the combobox that reads the database?
I've been asked by management to convert all of my applications from VB 2005 to VB 2008 (in preparation for taking them to VB 2010). I have a VS 2005 application that uses an ADO Data adapter which was defined using the GUI. I normally define my connections in code, but have been asked to get away from that in favor of ADO (and similar) data adapters.When I run the conversion wizard in VS 2008, it appears to convert this program, with some warnings and I get the 'Conversion Completed' dialog box. However, the VS 2008, will not let me close the dialog box, even after waiting for 3 hours. The only way to get out is to reboot the system.
Are the codes generated from Visual Studio.net 2003 Visual Basic fully convertible and compatible ti Visual Basic 2005 Express Edition ? I tried converting a project which was develop from VS 2003 for VB 2005 but after the process there are some commands which is not supported in the latter version. The deployment module in this project is also not recognised in VB 2005.
How do I(Can I) code a conditional statement in a TableAdapter query? I have a product code which can be either 8 or 9 characters long. Product codes are stored in an Access 2003 db table. I need to group products so in Access I have a simple Function which work fine in a Jet SQL query. But I can't get it to work in VB 2005.
Public Function ProdCats(ByVal Prod as string) Dim Cat as string = Len(Prod) Select Case Cat
I've seen this in two different places & can't quite figure it out. I can think of at least two possibilities but don't have a lot of confidence in either.When stepping thru code I encounter the following:
If x = True Then y = New ContextMenu Me.ContextMenu = y
[code]....
x is False. The debugger stops on the If & I press F11 to evaluate it. The Debugger then advances to Me.y.MenuItems.Add(z), which is *not* the next statement that should execute. Nor does it appear as if it does execute as, when I press F11 again, the Debugger exits the Sub, as it should. But why highlight it as if it will execute?This is even more confusing in the next example:
If Not Me.FindForm Is Nothing Then If Not TypeOf Me Is A AndAlso Not TypeOf Me Is B Then Me.x = "OFF" End If
[code]....
Me.FindForm is a Form, so it's not Nothing. Me is type A so the 2nd If is False. The Debugger stops on the 1st If, I press F11 & it advances to the 2nd If, as it should. Then I press F11 again & it advances to FatalException in the Catch block. What? Did the attempt to evaluate the TypeOf Me cause an error? It shouldn't, and it doesn't seem as if it did as F11 again exits the Sub rather than stepping into FatalException. So why did it stop there?
My first thought was that the intermediate code got out of step with the displayed source code. I've seen that in other IDE's with interactive debuggers, but usually because those allow you to run the Debugger without re-compiling the code. Not so with VS-so that seems unlikely.My second thought is that it's stopping there because those are the last 'executable' statements in the Sub. But that doesn't really make sense as, in other Subs, it will stop on the End Sub.
I have problem with select case statement. When I click the button, nothing have happens.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim google As String Select Case google Case 0
I want to learn abt how to use goto statement in vb.net 2005 because if i want to send the control from one form to other form then i want to use goto statement in vb.net 2005
But if I want to use the Project Properties, Reference tab to select a namespace to allow a project-wide setting, is it possible to alias that namespace?