473,394 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

int32.parse

Can anybody convert this from VB.NET to C#?

If Int32.Parse(ID) = Int32.Parse(dt.Rows(iLoop)("ID")) then
Return iLoop
End If

Thanks,

lfc77

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
3 11114
Mike,

This is what you want.

if (Int32.Parse(ID) = Int32.Parse((string) dt.Rows[iLoop]["ID"]))
return iLoop;

This is assuming that the type of ID in the datatable is a string.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Mike P" <mr*@telcoelectronics.co.uk> wrote in message
news:eo***************@TK2MSFTNGP10.phx.gbl...
Can anybody convert this from VB.NET to C#?

If Int32.Parse(ID) = Int32.Parse(dt.Rows(iLoop)("ID")) then
Return iLoop
End If

Thanks,

lfc77

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2
On Thu, 21 Aug 2003 06:15:39 -0700, Mike P <mr*@telcoelectronics.co.uk>
wrote:
Can anybody convert this from VB.NET to C#?

If Int32.Parse(ID) = Int32.Parse(dt.Rows(iLoop)("ID")) then
Return iLoop
End If

Thanks,

lfc77

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


if(Int32.Parse(ID) == Int32.Parse(dt.Rows[iLoop]["ID"])
{
return iLoop;
}

Not sure if that will work, but you can try.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #3
This is my code...I keep getting the error 'denotes a 'property' where a
'method' was expected'. Any ideas?

<asp:TemplateColumn HeaderText="CallType">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "CallType") %>
</ItemTemplate>

<EditItemTemplate>
<asp:DropDownList runat="server" id="lstCallTypes"
DataValueField="CallType"
DataTextField="CallType"
DataSource='<%# GetCallTypes() %>'
SelectedIndex='<%#
GetSelIndex(Container.DataItem("CallType")) %>'
/>
</EditItemTemplate>

</asp:TemplateColumn>
private int GetSelIndex(string strCallType)
{
int intLoop;
//Loop through each row in the DataSet
DataTable dt = ddlDataSet.Tables["CallTypes"];

for (intLoop = 0; intLoop >= dt.Rows.Count-1; intLoop ++)
{
if (Int32.Parse(strCallType) =
Int32.Parse((string)dt.Rows[intLoop]["CallType"]))
{
return intLoop;
}
}
}

Thanks,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt Creely | last post by:
I'm creating a DTS package to import some data from our HP3000, using the minisoft odbc driver as a linked server within sql server. I'm importing a table from the HP3000 (which I've done lots of...
2
by: Black_angel | last post by:
Hello everybody, I want to cast an integer of 32 bits in a byte id. How can I break the Int32 id up to set it in the 4 first positions of the array of byte? and then, How can I get the full...
2
by: Tu-Thach | last post by:
Ron, What are you trying to do? Read from a database? This error indicates that you are trying to read an int, but the value is outside the range of an integer: - 2,147,483,648 through...
6
by: Jeff Reed | last post by:
Doing something like this (cast) doesn't work. Y.value = (Int32)stringvariable; I get this message: Cannot convert type 'string' to 'int' Any idea how I can convert string to Int32? thxs
3
by: Tim Osborne | last post by:
I want to know if a call to Convert.Int32 can handle a Culture specific string. I have the following code: string sText = "111,111,111"; int i; i = Convert.Int32(...
3
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
16
by: Jim in Arizona | last post by:
I'm familiar with CInt(value) but I'm not with Int32.Parse(value). They seem to do the same thing. Is there a big difference between the two and when would one be best applied over the other? ...
1
by: Paul Aspinall | last post by:
Hi Can anyone offer a comparison of System.Convert.ToInt32 vs Int32.Parse Thanks
3
by: psycho | last post by:
what is the difference between the two forms of converting to integer from string string strVal = "10"; Convert.ToInt32(strVal); Int32.Parse(strVal); which method is more efficient in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.