473,609 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mid and InStrRev conversion to c#

Hello,

I am converting a DataList from vb to c#. I am having a problem converting
the Mid function with InStrRev to c#. Any help with this would be
appreciated.

<asp:DataList id="dlstPhotoGa llery" Runat="Server"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<a href='<%# Replace(Contain er.DataItem,"_m ini","") %>' target="_blank" >
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%# Container.DataI tem %>'
ToolTip='<%# Mid(Container.D ataItem, InStrRev(Contai ner.DataItem, "/")
+ 1) %>' Runat="Server" />
</a>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
--
Thanks in advance,

sck10
Aug 12 '06 #1
5 3649
For Mid, you can use a substring. Put the position (0 based) and the length
you desire. I forget what InStrRev contains.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ****
Think outside of the box!
*************** *************** *************** ****
"sck10" <sc***@online.n ospamwrote in message
news:uS******** ******@TK2MSFTN GP04.phx.gbl...
Hello,

I am converting a DataList from vb to c#. I am having a problem
converting the Mid function with InStrRev to c#. Any help with this would
be appreciated.

<asp:DataList id="dlstPhotoGa llery" Runat="Server"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<a href='<%# Replace(Contain er.DataItem,"_m ini","") %>'
target="_blank" >
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%# Container.DataI tem %>'
ToolTip='<%# Mid(Container.D ataItem, InStrRev(Contai ner.DataItem, "/")
+ 1) %>' Runat="Server" />
</a>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
--
Thanks in advance,

sck10

Aug 12 '06 #2
Mid - String.Substrin g()
InStrRev - String.LastInde xOf()

"sck10" <sc***@online.n ospamwrote in message
news:uS******** ******@TK2MSFTN GP04.phx.gbl...
Hello,

I am converting a DataList from vb to c#. I am having a problem converting
the Mid function with InStrRev to c#. Any help with this would be
appreciated.

<asp:DataList id="dlstPhotoGa llery" Runat="Server"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<a href='<%# Replace(Contain er.DataItem,"_m ini","") %>' target="_blank" >
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%# Container.DataI tem %>'
ToolTip='<%# Mid(Container.D ataItem, InStrRev(Contai ner.DataItem, "/")
+ 1) %>' Runat="Server" />
</a>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
--
Thanks in advance,

sck10
Aug 12 '06 #3
The following was produced with our Instant C# VB to C# converter (asp.net
snippet tab):

<asp:DataList id="dlstPhotoGa llery" Runat="Server"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<a href='<%#Contai ner.DataItem.Re place("_mini", "")%>'
target="_blank" >
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%#Co ntainer.DataIte m%>'

ToolTip='<%#Con tainer.DataItem .Substring((Con tainer.DataItem .LastIndexOf("/")
+ 1))%>'
Runat="Server" />
</a>
</ItemTemplate>
</asp:DataList>
</asp:Panel>

By the way, while Reflector is a great tool, it's impractical for most
conversion purposes. The main goal in conversion is not just to get code
that runs in another language, but to get code that conveys the same
information and is understood. Any tool that converts to IL and back again
will be obscured with convoluted IL interpretations & optimizations and
missing comments. In addition, it would be very impractical to convert
ASP.NET in-line code.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
C# Code Metrics: Quick metrics for C#
"sck10" wrote:
Hello,

I am converting a DataList from vb to c#. I am having a problem converting
the Mid function with InStrRev to c#. Any help with this would be
appreciated.

<asp:DataList id="dlstPhotoGa llery" Runat="Server"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<a href='<%# Replace(Contain er.DataItem,"_m ini","") %>' target="_blank" >
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%# Container.DataI tem %>'
ToolTip='<%# Mid(Container.D ataItem, InStrRev(Contai ner.DataItem, "/")
+ 1) %>' Runat="Server" />
</a>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
--
Thanks in advance,

sck10
Aug 12 '06 #4
Thanks David, appreciate the help...
"David Anton" <Da********@dis cussions.micros oft.comwrote in message
news:B3******** *************** ***********@mic rosoft.com...
The following was produced with our Instant C# VB to C# converter (asp.net
snippet tab):

<asp:DataList id="dlstPhotoGa llery" Runat="Server"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<a href='<%#Contai ner.DataItem.Re place("_mini", "")%>'
target="_blank" >
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%#Co ntainer.DataIte m%>'

ToolTip='<%#Con tainer.DataItem .Substring((Con tainer.DataItem .LastIndexOf("/")
+ 1))%>'
Runat="Server" />
</a>
</ItemTemplate>
</asp:DataList>
</asp:Panel>

By the way, while Reflector is a great tool, it's impractical for most
conversion purposes. The main goal in conversion is not just to get code
that runs in another language, but to get code that conveys the same
information and is understood. Any tool that converts to IL and back
again
will be obscured with convoluted IL interpretations & optimizations and
missing comments. In addition, it would be very impractical to convert
ASP.NET in-line code.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
C# Code Metrics: Quick metrics for C#
"sck10" wrote:
>Hello,

I am converting a DataList from vb to c#. I am having a problem
converting
the Mid function with InStrRev to c#. Any help with this would be
appreciated.

<asp:DataLis t id="dlstPhotoGa llery" Runat="Server"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<a href='<%# Replace(Contain er.DataItem,"_m ini","") %>'
target="_blank ">
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%# Container.DataI tem %>'
ToolTip='<%# Mid(Container.D ataItem, InStrRev(Contai ner.DataItem,
"/")
+ 1) %>' Runat="Server" />
</a>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
--
Thanks in advance,

sck10

Aug 13 '06 #5
Thanks Siva...
"Siva M" <sh******@onlin e.excite.comwro te in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Mid - String.Substrin g()
InStrRev - String.LastInde xOf()

"sck10" <sc***@online.n ospamwrote in message
news:uS******** ******@TK2MSFTN GP04.phx.gbl...
Hello,

I am converting a DataList from vb to c#. I am having a problem
converting
the Mid function with InStrRev to c#. Any help with this would be
appreciated.

<asp:DataList id="dlstPhotoGa llery" Runat="Server"
RepeatDirection ="Horizontal ">
<ItemTemplate >
<a href='<%# Replace(Contain er.DataItem,"_m ini","") %>'
target="_blank" >
<asp:Image ID="imgPhotoGal lery" ImageUrl='<%# Container.DataI tem %>'
ToolTip='<%# Mid(Container.D ataItem, InStrRev(Contai ner.DataItem, "/")
+ 1) %>' Runat="Server" />
</a>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
--
Thanks in advance,

sck10


Aug 13 '06 #6

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

Similar topics

1
5648
by: Stub | last post by:
Docs says that "The compiler does not use an explicit constructor to implement an implied conversion of types. It's purpose is reserved explicitly for construction." I put up code of three cases at the bottom. Hope you can help me understand the "explicit" keyword and its usage. Specifically, Is "explicit" keyword only associated with constructor in C++? What's "implied conversion of types"?
7
3256
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But I couldn't find the exact rule in the C++ standard. And what if the classes have template parameters? It would be great if somebody could get me a rough hint where in the
2
5823
by: William Ortenberg | last post by:
I have a client who can't get off of Access97. I want to use the InStrRev function, but it's not available in 97. Is the function's code available? Is there any equivalent functions for 97? Thanks in advance.
11
7605
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type Test. I expected the same error from the following line, but it compiles fine. The double is silently truncated to an int and then fed in to the implicit conversion operator. Why does this happen? Is there any way that I can keep the implicit...
2
6864
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public static explicit System.IntPtr (long);
3
4446
by: Steve Richter | last post by:
here is a warning I am getting in a C++ .NET compile: c:\SrNet\jury\JuryTest.cpp(55) : warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied while calling the constructor 'MyString::MyString(const wchar_t *)' c:\SrNet\jury\JuryTest.h(21) : see declaration of 'MyString::MyString' The class "StringData" uses a, whatever you call it, operator const
7
5016
by: alanwo | last post by:
Hi Experts, Connected to Access MDB file using ADO.net OLEDB, I have a SQL to get file extension from file name which is stored as field. SELECT Right(FileName, Len(FileName) - InStrRev(FileName, '.')) FROM Files This query work in MS ACCESS enivronment but not VB.net program connecting to the database.
0
2287
by: Lou Evart | last post by:
DOCUMENT CONVERSION SERVICES Softline International (SII) operates one of the industry's largest document and data conversion service bureaus. In the past year, SII converted over a million pages to a variety of formats. SII's service bureau has a reputation as being a least-cost provider that can offer a timely turnaround with 100% accuracy. Here are some of the formats SII has converted over the last 20 years:
4
4964
by: Andrew | last post by:
One year ago I have programmed in VB. There was a function named "InStrRev". In C# I don't have found a similar function. Can anybody help me in this question. Thanks a lot regards andrew
0
8139
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8579
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8555
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7024
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6064
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5524
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4032
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4098
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.