469,602 Members | 1,715 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

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 10983
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Black_angel | last post: by
2 posts views Thread by Tu-Thach | last post: by
6 posts views Thread by Jeff Reed | last post: by
3 posts views Thread by Tim Osborne | last post: by
3 posts views Thread by Convert TextBox.Text to Int32 Problem | last post: by
16 posts views Thread by Jim in Arizona | last post: by
1 post views Thread by Paul Aspinall | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.