Solved

INSRT/mid use in VB.net

Posted on 2004-09-20
7
194 Views
Last Modified: 2006-11-17

How do I get the parsing on this in vb.net?

Given :  August 31, 2004. htm

I want to get  the result to show -    August 31, 2004

that is to the left of ".htm"



0
Comment
Question by:zachvaldez
  • 4
  • 3
7 Comments
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 12109127
Hi there,

Dim Str As String = "August 31, 2004. htm"
Str = Str.SubString(0,Str.LastIndexOf("."))

Now the Str will have "August 31, 2004"

-Baan
0
 

Author Comment

by:zachvaldez
ID: 12109175
So in this case scenario DotNetLover, BTW ,THanks in a  million!
                  I'd like to get only the August 31,2004 from the August 31,2004.htm
                            how is that done please..
                       dra.name here is the full filename-  August 31,2004.htm

            For Each dra In diar1
                Dim dr As DataRow = ds.Tables(0).NewRow()
                dr(0) = dra.Name
                dr(1) = "c:\Events\HTML\" & dra.Name
                ds.Tables(0).Rows.Add(dr)
            Next
0
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 500 total points
ID: 12109286
Here you go...

            For Each dra In diar1
                Dim dr As DataRow = ds.Tables(0).NewRow()
                dr(0) = dra.Name.SubString(0,dra.Name.LastIndexOf("."))
                dr(1) = "c:\Events\HTML\" & dra.Name
                ds.Tables(0).Rows.Add(dr)
            Next

-Baan
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:zachvaldez
ID: 12111950
IN this DDL, Id liek to see the first row blank so that the first data is in the second row when the selectedchanged index is fired.
thanks
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 12112091
Which DDL ? Where is ur DDL ? What are you doing in the selectedIndexChanged ? Please explain...
Note:  You can always do DDL.SelectedIndex = -1   to show blank.

-Baan
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 12112123
or, Insert a blank after populating the DDL:
DDL.Items.Insert(0, "--Select All--")    -OR- DDL.Items.Insert(0, "")
-Baan
0
 

Author Comment

by:zachvaldez
ID: 12113449
Wow! There many ways to do it then!
Thanks for your help and I'll try each way.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question