Convert C# To Program (ToString("c"))?
Sep 16, 2009How do you convert this from c# to vb the ToString function with parameter "c"?
<%= Model.ComputeTotalValue().ToString("c") %>
How do you convert this from c# to vb the ToString function with parameter "c"?
<%= Model.ComputeTotalValue().ToString("c") %>
I've been programming in vb.net a lot for the last 9 weeks and I have just come across a lot of double functionalities (hope I used the right word for that).For instance, you can use CInt, CType, Directcast or Convert to turn something into a integer. (Directcast doesn't really belong in that line but whatever).
With calling methods you can do DoWork() or call DoWork()With returning values in functions you can do DoWork() = 3 or return 3 Why is this? Is it just to make the transition frm vb6 to vb.net easier? Or about giving the programmar a lot of options. I must admit I don't really like to have that choice, I am always in doubt whether I am using the right method .
I use the expression below to evaluate for a certain value, '91'. If however, the value at that array position is '0B' a System.FormatException is thrown. How do I alter the evaluation so this exception won't be thrown?
View 12 RepliesI think that my previous post wasn't what I should have been asking. I think my issue has to do with Convert.ToString in my code I have this 3 times, I have no errors while writing the code, only when I debug it I get the error message "input string was not in correct format"
Private Sub DisplayBill()
lblSlicesTotal.Text = Convert.ToString(numofSlice * Slicefee)
lblFriesTotal.Text = Convert.ToString(numo
[code].....
1. What's the difference between ToString and ToString()? (i do know that ToString method is to cast numeric values to string but don't know how to get it to work)
2. Why do i need XML comment feature? is it necessary?
This is going to be a lot to ask, but I'd like to convert my old GW-BASIC program to a command line program with arguments. I'd like it to operate as follows:
elapse [drive:][path]filename This is my old code.
5 CLS
10 OPEN "G:Calc.txt" FOR INPUT AS #1
20 WHILE NOT EOF(1): INPUT #1, A$, B$
30 IF MID$(A$,3,1)=":" THEN C$="DOUBLE DIGIT":GOTO 50
40 IF MID$(A$,2,1)=":" THEN C$="SINGLE DIGIT":GOTO 120
[Code]...
I have a few questions reguarding converting a Access program to a sql/vb.net program. I know these are vague questions, so feel free to give vague answers.
NOTES: I have a solid unstranding of SQL and VB.net. i have little Access experience, but i would be working with the individual who created the access program. I also don't have alot of experience in converting on program from one language to another. Most of my experience is in new programing.
[Q1] Is their a general rule of thumb when converting/recodeing on how long it should take? i.e. if this project would take me 40 hours to write my self from scratch it would take me 30 hours to recode into another language?
[Q2] What type of problems do i need to look out for when working on projects of this nature and being inexperinced?
I have developed some programs for processing and issue-coding electronic documents. I am teaching myself how to work with SQL Server because I want these programs to work with electronic documents imported into SQL Server as opposed to messing around in a folder stuck on the desktop, for example. From there I want to expand on the program so that it is a network enabled program.
[Code]...
I have no idea how to do this, but I want to create a [I dont know what it is called] to allow me to convert a class property to another type.The I could use the following w/ the new type:
Dim stringPhoneNo as String = "(111)111-1111" Dim typePhoneNo as PhoneNumber = stringPhoneNo.ToPhoneNumber()
When a custom class overrides the ToString() method, the C# IDE uses this function to display the class in the debug mode(tooltips, watcher etc) Does the VB.NET the same? I have impression that overriding ToString() method does change nothing. I mean, in the watcher I see Name myBusinessObjectInsnace Value {MyNamespace.myBusinessObjectInsnaceType}
View 4 RepliesIf you try to compile the query below in Visual Basic .NET, it fails. From x In {1, 2} Select x.ToString() The error given by the compiler is: Range variable name cannot match the name of a member of the 'Object' class. There is nothing wrong with the equivalent C# query, though: from x in new[]{1, 2} select x.ToString()
This does not happen with the ToString overload that takes a format (it is a member of Int32, not Object). It does happen with other members of Object, as long as they don't take an argument: with GetType and GetHashCode it fails; with Equals(object) it compiles.
I notice you can't use textbox control array in .net. Wondering how to workaround this code.
Private Sub cmdNew_Click()
Dim row As Integer, col As Integer
For col = 1 To maxCol
For row = 1 To maxRow
txtCell(Indx(row, col)).Text = ""
[Code]...
I'm trying to convert a program from VB6 to DOT NET. In my original program I have a menu array which was simple to create.I simply named each menu element the same name and assigned each a different Index property.In DOT NET, there is no Index property and trying to create a second menu item with the same name generates an error. I have been unable to find any info that helps me transfer the functionality to DOT NET.
Can someone help with my struggle to make the leap to DOT NET?I'm also trying to convert use of the MSHFlexGrid in VB6 to the DataGridView tool in DOT NET and this is driving my to distraction. I've figured out some things already with lots of web searches but selecting a column to sort and sorting it still eludes me.
hat this VB6 statement does?
BK(1) = IB(1) B0
And W1
what the back slash means. I am trying to convert a VB6 pgm to VB.Net.
I have this code that gets the hostname,IP and MAC address of computers under a certain domain name. but it is in C#. i am required to run the code under vb.net.[code]...
View 5 RepliesI've been trying to convert a little code snippet from C# to VB, but it s too hard for me.The problem is that it�s using Delegate and event handling[code]...
View 2 RepliesHow to convert pdf in to xml using vb.net.(windows)
View 3 RepliesI tried the code below to convert it to c#. But i am getting many errors when i use it.Like error related to || and && symbols using in c# version.[code]...
View 4 RepliesCan anyone can convert this SQL script in to a visual basic source code?..I know how can i do that in executing a stored procedure without parameter.But I have a hard time doing it with stored procedure with parameter.[code]....
View 1 Replies[code]...Convert To program From C#?
View 3 RepliesAm converting a VB6 project to VB.Net and need help with "AS ANY" type declaration in a function declaration.
Example:Declare Function BtrCall Lib "wbtrv32.dll" Alias "BTRCALL" (ByVal op%, ByVal PB$, db As Any) as integer
I know As Any is invalid in VB.Net
Most of the calls to this function will pass a String for the 3rd parameter however, there are two instances in my code where a User Defined Type /Structure is passed rather than string value.
My problem is that I'm trying to parse a String to a System.Drawing.Color. Im trying to set up a simple notepad, here's part of my code:
Private Sub ToolStripMenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Colorfuente2.Click
Try
Dim cdlg As New ColorDialog[code].....
I've googled like crazy and tried MSDN but I can't get a clear answer what to use ToString for.
View 11 RepliesI just converted a VB.net solution into C# solution. But lots of variables have been coverted like:
string var1 = (string)1;
string var2 = (string)intVar; //intVar is a int value
I just want to convert all (string)XXXX to XXXX.ToString() by using some Regular expressions or some other replace methods.
I know that i use a "c" for American Currency is there a ToString value used for Mexican Pesos?
View 2 RepliesMany times i was not getting correct output,then i put .tostring() at the end then it gave good output.so basically why do v need this?also Convert.ToInt32(cmd.ExecuteScalar()) why convert to int32?
View 1 RepliesI have a program I made in VB 6 which has probably hundreds of thousands of lines of code.
Is it complicated to convert it to VB.Net or is it not worth it?
My main problem is that VB 6 doesn't work in Win 7 so I need to use the XP emulator each time I make an update.
I'm new to visual basic.
1) Why when I load vb6 files in vb2010 it shows many errors?
2)Hold on tight please here it goes: Removed by Moderator since the question violates our AUP
I am trying to convert a program for VB6 to VB2008. In VB6 I have the code below to load a database field into a variable.
The database = Local MS Access MyDatabase has a table in it called CoInfo which has a field CustID that I need to put in a variable gCustID.
This code works greatin VB6 but I can't for the life of me figure out how to accomplish this in the Visual Basic 2008.
Dim adoCon As New ADODB.Connection
Dim adoRec As New ADODB.Recordset
Dim MyPath
[Code]....
I have managed to take a screenshot of my computing using VB and I have stored it as a bitmap. I want to convert this bitmap (quickly!) to an array of rgb values.[code]...
View 1 Replies