|
azam316 wrote:
i have to use a class written in C# through VB.NET for my project.
Just add a new C# Class Library project to your existing solution. This new project will be compiled to a DLL. Then reference the C# project in your VB.NET project (also remember to check the project dependencies). Of course you could also first compile the C# sources to a DLL and then reference the compiled DLL. But using a multi-project solution has the advantage of enabling you to quickly change the C# sources if necessary. For more details see Managing Solutions, Projects, and Files[^] (in particular Multi-Project Solutions[^]).
Best regards
Dennis
|
|
|
|
|
thanx a lot Dennis. u r a life saver!!
thanx again!
☺«««DTA»»»☺
|
|
|
|
|
hi I am having this problem where i have a Text file with data
000189,380661,SUPERSTAR VIRGO,410081,0813,2.200,5.76,12.67,.....
which i need to read and spreadly placed into selected colume of a ListView.
Below is the VB.net code i currently have & onli able to display the data from the 1st cloume instead of assigning:
...
If (openFiledlg.CheckFileExists()) Then
flag = True
txtSAPsrc.Text = openFiledlg.FileName
FileOpen(1, openFiledlg.FileName, OpenMode.Input)
Do While Not EOF(1)
Input(1, str)
If Microsoft.VisualBasic.Left(LTrim(str), 1) <> "," And Trim(str) <> "" Then
mitem = New ListViewItem(str.Split(","), 0)
lstvReport.Items.AddRange(New ListViewItem() {mitem})
End If
Loop
End If
.....
Help greatly appreciated.
|
|
|
|
|
Why not read each input line into a single string then use the Split function of that string with a delimiter of ',' to split the input into an array of objects which you can then interate through.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
the code i posted together was able to store all the content into the str variablem split them by "," and display the data starting from he 1st colume of the listview. But how should i do it in the way i can set certain value of the input line into certain seleted colume
|
|
|
|
|
kobezt08 wrote:
If (openFiledlg.CheckFileExists()) Then
This is not what you need to do at this point. You want to figure out if the file exists. The FileDialog.CheckFileExists Property[^] however only specifies if the dialog should warn the user if the file does not exist. What you need here is the File.Exists Method[^].
kobezt08 wrote:
txtSAPsrc.Text = openFiledlg.FileName
When naming your fields in VB.NET don't use the old VB Object Naming Conventions[^] with prefixes. Use the new Design Guidelines[^] instead no matter which programming language you use.
kobezt08 wrote:
FileOpen(1, openFiledlg.FileName, OpenMode.Input)
I recommend to use the base classes from the System namespace (personally, I think the whole Microsoft.VisualBasic namespace is only about backwards compatibility). Therefore the appropriate object would be an instance of the StreamReader Class[^].
kobezt08 wrote:
mitem = New ListViewItem(str.Split(","), 0)
lstvReport.Items.AddRange(New ListViewItem() {mitem})
I don't know if there is a more elegant way but I suggest to create a new ListViewItem[^] with all the belonging sub items and add that to the ListView.Items[^] collection. Also don't use str.Split(",") but str.Split(","c) because the first version won't compile with Option Strict[^] on (Option Explicit[^] should be switched on too).
After some additional declarations...
Dim InputReader As StreamReader
Dim InputLine() As String
Dim Counter As Integer
...my suggestions looks like this:
If File.Exists(openFiledlg.FileName) Then
flag = True
txtSAPsrc.Text = openFiledlg.FileName
InputReader = New StreamReader(openFiledlg.FileName)
Str = InputReader.ReadLine()
Do Until Str Is Nothing
InputLine = Str.Split(","c)
mitem = New ListViewItem(InputLine(0))
For Counter = 1 To InputLine.Length - 1
mitem.SubItems.Add(InputLine(Counter))
Next Counter
lstvReport.Items.Add(mitem)
Str = InputReader.ReadLine()
Loop
End If
Best regards
Dennis
|
|
|
|
|
Thanks so much for all th ehelpful tips....
Just 1 more question how do i set the data to be displayed on select colume?
example: iI wish to put "000189" in the 1st colume and "SUPERSTAR VIRGO" on like 5th colume.
And btw in str.Split(","c), wat is the c stand for & wat does InputLine(0) do, cos i cant find info on InputLine() on msdn? Char?
|
|
|
|
|
kobezt08 wrote:
Just 1 more question how do i set the data to be displayed on select colume?
Since we're just adding items to a collection and we can't directly replace the collection itself (the ListViewItem.SubItems Property[^] is read-only) I guess the only possibility is to throw in some extra (empty) items. Try adding some of these:
mitem.SubItems.Add(New ListViewItem.ListViewSubItem)
kobezt08 wrote:
And btw in str.Split(","c), wat is the c stand for
The c tells the compiler that the character is a char and not a string (see Visual Basic Language Reference: Char Data Type[^]).
kobezt08 wrote:
what does InputLine(0) do, cos i cant find info on InputLine() on msdn?
Nothing. Just an array of strings I declared.
Best regards
Dennis
|
|
|
|
|
thank you very much for your help.
guess I learnt something new tonight
Merry Christmas
|
|
|
|
|
can anyone tell me how to make ones application in VB to run one s only from a setup that is if i sell my application in a CD to any Client then how can i ensure that he can run it only once
thanx in advance
merry christmas to u all
;) ;) ;)
|
|
|
|
|
You really can't. There are libraries out there that will help with this, but they cost $ and are not fool proof solutions.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanx a lot for replying ,
but there r people doing this and which libraries r there with this stuff or where can we find that
thanx and bye
(
|
|
|
|
|
Hi all formatted my system and am having problem in adding Data report to my project in VB 6.0, it says error no 429 thats either active control corrupted or user dont have license to use this control
plz help me out of this trouble
thanx all
merry christmas
|
|
|
|
|
Did you reinstalled Visual Studio 6 Service Pack 6 when you reformatted your system?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for your valuable input and you taking time to reply
i did reinstall service pack 5 not service pack 6 i never used service pack 6 .....also same is the problem faced in other system too....
thanx for reply
belated merry christmas to u
;)
|
|
|
|
|
Yoo... thx 4 helping friend....
:::Widhie:::
|
|
|
|
|
Hi,
I’m technical uni research student. I need to develop an application in VB.Net. My task is add, modify and delete records from database table. I have activity table, task table, resources, skill and etc.
How to save the data for project A and B. E.g. The project A’s data should saved in different file name (eg ***.dat)? Or create new databse tables Project A data in different table and project B data in different table.
Rgds,
Preesteya
|
|
|
|
|
I really can't understand your question, but the method you should use to store data would have already been covered in your class...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all:
Text substitution and some basic text operations in MS Word with large amount of Docs can be both time-comsuming and effort-consuming, and you easily get exhausted.
I want to apply a VBA code applet which can delete the space between a Chinese character and English letter, for example "非_f" becomes "非f", but I don't know how to recognize the Chinese character and English letter by code. Can anybody provides a solution?
The following code might help!
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ") 。"
.Replacement.Text = ")。"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
|
|
|
|
|
:-Dhai... everyone.. who know how to use the vb.net to perform the silent installation?
For this purpose, because i want to perform install s/w program that means can install program at 10 client pc at ths same time.
Actually, i want use the install.inf file to perform the silent installation, but i also dont know the command for .inf file.
So, everyone who know about this!!! that give me some guideline(web site or coding) to do this.....
Thanks you!
|
|
|
|
|
Hi,
How to change the format of date and time in MS Statusbar control.
Be simple and Be sample.
|
|
|
|
|
string formattedDate;
// Format : 07 / 03 / 2004
formattedDate = DateTime.Now.ToString("dd / MM / yyyy");
// Format : 7 / 3 / 2004 (without the preceding zeroes)
formattedDate = DateTime.Now.ToString("d / M / yyyy");
// Format : 07 / Mar / 2004
formattedDate = DateTime.Now.ToString("dd / MMM / yy");
// How to get the name of the day ?
// Format : Wednesday
formattedDate = DateTime.Today.DayOfWeek.ToString();
Here is it :
http://www.dotnetspider.com/technology/kbpages/276.aspx[^]
----------------------------------------------------------------------
T Manjaly
My C# Tutorials articles www.dotnetspider.com
|
|
|
|
|
hi
can any one plz help me ....
how to access images (icons and bitmaps) which is already compiled in to a "Resource DLL" in vb dot net dynamically
thanks
Ravi
|
|
|
|
|
|
Dear all,
In my project need view Grid like this :
------------------
| 1 | 2 |
|----------------|
| a | b | c |
-----------------
I want to merge cell in header of Grid and cell data in grid. We can do or not? Please help.
Thanks n advance !
HoanhND
|
|
|
|