|
Dim sLine,sa(),sCode,sItemCode,sDescription
Open "TESTFILE" For Input As #1
Line Input #1, sLine ' Read line into variable.
Do While Not EOF(1)
sa = split(sLine,",")
sCode = Replace(sa(0),"""","")
sItemCode = Replace(sa(1),"""","")
sDescription = Replace(sa(2),"""","")
Call ProcessRow(sCode,sItemCode,sDescription)
Line Input #1, sLine ' Read line into variable.
Loop
Close #1
|
|
|
|
|
Thanks for your reply,
I thought of using the split function to split the line at commas, but I also thought that whould be a problem with embedded commas.
If thats the case I'm replacing one problem with another.
Regards Alan
|
|
|
|
|
alanhauxwell wrote: I thought of using the split function to split the line at commas, but I also thought that whould be a problem with embedded commas.
If thats the case I'm replacing one problem with another.
You will probably need to parse the string that you read in...
a , followed by " is end of field
end of line is end of field
or some such thing...
Hopefully, you will never get a comma and a double-quote adjacent to each other in your data
Hope this helps
|
|
|
|
|
Hello!
In Windows task manager there are "USER NAME", "CPU" and "MEM USAGE". I would like to know how I can reach these values in vb.net. I am currently able to list all the running processes but no clue how to display the others. I have tried but couldn't get others working Thanks for your help!
Here is my simple code in vb.net /2005
<br />
Private Sub LoadProcessModules()<br />
<br />
Dim myProcesses() As Process<br />
Dim myProcess As Process<br />
Dim I As Int32 = 1<br />
<br />
myProcesses = Process.GetProcesses()<br />
<br />
' Iterate through the process array.<br />
For Each myProcess In myProcesses<br />
I = ListView1.Items.Count<br />
ListView1.Items.Add(myProcess.ProcessName)<br />
ListView1.Items(I).SubItems.Add(myProcess.Responding)<br />
Next<br />
<br />
End Sub<br />
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
You can use the PerformanceCounter class - there's a bit of an example here...[^]
|
|
|
|
|
All of that information is in the Process class for each process you get from GetProcesses. The problem is you're using generic names for things that are a bit more complicated than what you think. For example, CPU usage is TotalProcessorTime, which is a combination of PrivilegedProcessorTime and UserProcessorTime.
Memory usage gets quite a bit more complicated. The values that have to do with memory are NonpagedSystemMemorySize, PagedMemorySize, PagedSystemMemorySize, PrivateMemorySize, VirtualMemorySize, WorkingSet, ..., among others.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
sir/madam,
i have data in the table and database(MS-Access) .Can i send the data into excel sheet.
please help.
thanks and regards
pankaj garg
|
|
|
|
|
Hi All
This is Sagar here. I have a problem. Can anyone help me out of this? I want to transfer the text written in a text box in a windows form to a crystalreport viewer in the button click event. I will be very grateful is somebody help me out of this.
Regards
Sagar Pattnayak
Sun-Dew Solutions
9831169962
|
|
|
|
|
Dim mNoOfObjects As Byte = 1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lbl As New Label()
Dim txt As New TextBox()
If mNoOfObjects < 20 Then
mNoOfObjects += 1
txt.Name = "TextBox" & mNoOfObjects
txt.Location = New System.Drawing.Point(TextBox1.Left, TextBox1.Top + (TextBox1.Height * (mNoOfObjects - 1)))
lbl.Name = "Label" & mNoOfObjects
lbl.Location = New System.Drawing.Point(Label1.Left, txt.Top)
lbl.AutoSize = True
lbl.Text = "Item Name - " & mNoOfObjects
Controls.AddRange(New System.Windows.Forms.Control() {lbl})
Controls.AddRange(New System.Windows.Forms.Control() {txt})
Else
MessageBox.Show("Cannot order more then 20 items in a bill", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Ctr As Byte
For Ctr = 1 To mNoOfObjects
' ***********************************************************
' How to display text of dynamically created textbox1, textbox2 ...
' ***********************************************************
Next
End Sub
Deepak
|
|
|
|
|
For Ctr = 1 To mNoOfObjects
msgbox(me.controls("TextBox" & Ctr).text)
Next
|
|
|
|
|
Thanks Dear
The statement <<< msgbox(me.controls("TextBox" & Ctr).text) >>> worked absolutely fine.
Deepak
|
|
|
|
|
Hi all,
I am trying to call a pl/sql procedure which is defined inside a package thru Visual Basic. I am getting an error message saying that
"....
...
Description=ORA-06550:line 11, column 1:PLS-00201:identifier 'LOCALBOARDING.UPDATEMOVEMENTDETAILS' must be declared ORA-06550:line11, column 1: PL/SQL statement ignored."
Here LOCALBOARDING is the package name and UpdateMovementDetails is the procedure name.
I am using ExecSQL method in VB. ie inside BEGIN and END block, I am trying to call the packagename.procedure with parameters.
If I copy the code in the backend means, its executing properly. But no thru VB. Kindly help.
Thanks in advance.
Surendran
|
|
|
|
|
Hello frends,
I have to prepare salary slip so want salary slip format.
Please Anyone give me Salary slip sample.
Thanks for any help in advance.
-Regards Priya.
"The Difficult i can do it now...
The Impossible will take a little longer."
|
|
|
|
|
Hi,
I think, Getting a salary slip from a person is not that much easy. Instead, you can search the net for sample salary slip formats.
Surendran
|
|
|
|
|
plz give me the answer
how to convert a digital value to words(thats in indian formate) in crystal report.
exm:
if the digit is 10 then we get "ten"
if the digit is 100000 then we get "one lakh"
hari
|
|
|
|
|
Dim currStr As String, finalStr As String, paramStr As String
Dim counter As Integer, strR As String, strL As String, cutFrom As Integer
Dim lvl As Integer, paiseStr As String
Public Function funGetNumberInWords(ByVal paramNum As String) As String
Dim paramStr As String
Dim cutFrom As Integer
Dim finalStr As String
Dim currStr, strR, strL As String
Dim counter, lvl As Integer
paramStr = paramNum
cutFrom = Len(paramStr): finalStr = "": currStr = "": strR = "": strL = "": counter = 1: lvl = 1
Do While counter <= Len(paramStr) 'Starts from Last Digit
currStr = "": strR = "": strL = ""
If lvl = 2 Then 'For Hundreds Place
strL = Mid(paramStr, cutFrom, 1)
strR = ""
counter = counter + 1
cutFrom = cutFrom - 1
Else
strR = Mid(paramStr, cutFrom, 1)
If cutFrom - 1 > 0 Then
strL = Mid(paramStr, cutFrom - 1, 1)
End If
counter = counter + 2
cutFrom = cutFrom - 2
End If
currStr = NumToWords(lvl, strL, strR) 'Conv Function
finalStr = currStr + finalStr
lvl = lvl + 1
Loop
funGetNumberInWords = RTrim(finalStr)
Label1.Caption = finalStr
End Function
Private Function NumToWords(ByVal lvl As Integer, ByVal str1 As String, ByVal str2 As String, Optional ByVal isAfterDec As Boolean = False) As String
NumToWords = ""
If lvl = 2 Then
NumToWords = NumName(str1, "Units")
Else
If str2 <> "" Then
Select Case str1
Case "0", "": NumToWords = NumName(str2, "Units")
Case "1": NumToWords = NumName(str2, "Teens")
Case Else: NumToWords = IIf(str2 = "0", NumName(str1, "Tys"), NumName(str1, "Tys") & NumName(str2, "Units"))
End Select
Else
NumToWords = NumName(str1, "Units")
End If
End If
If isAfterDec Then
NumToWords = Trim(NumToWords)
Else
NumToWords = ValueName(NumToWords, lvl)
End If
End Function
Private Function NumName(ByVal s As String, ByVal lvl As String) As String
If Len(s) = 0 Or Len(lvl) = 0 Then Exit Function
If lvl = "Units" Then
Select Case s
Case "0": NumName = "Zero"
Case "1": NumName = "One"
Case "2": NumName = "Two"
Case "3": NumName = "Three"
Case "4": NumName = "Four"
Case "5": NumName = "Five"
Case "6": NumName = "Six"
Case "7": NumName = "Seven"
Case "8": NumName = "Eight"
Case "9": NumName = "Nine"
End Select
End If
If lvl = "Teens" Then
Select Case s
Case "0": NumName = "Ten"
Case "1": NumName = "Eleven"
Case "2": NumName = "Twelve"
Case "3": NumName = "Thirteen"
Case "4": NumName = "Forteen"
Case "5": NumName = "Fifteen"
Case "6": NumName = "Sixteen"
Case "7": NumName = "Seventeen"
Case "8": NumName = "Eighteen"
Case "9": NumName = "Nineteen"
End Select
End If
If lvl = "Tys" Then
Select Case s
Case "2": NumName = "Twenty "
Case "3": NumName = "Thirty "
Case "4": NumName = "Forty "
Case "5": NumName = "Fifty "
Case "6": NumName = "Sixty "
Case "7": NumName = "Seventy "
Case "8": NumName = "Eighty "
Case "9": NumName = "Ninety "
End Select
End If
End Function
Private Function ValueName(ByVal inVal As String, ByVal lvl As Integer) As String
If inVal <> "" And inVal <> "Zero" Then
Select Case lvl
Case 1: ValueName = inVal
Case 2: ValueName = inVal & " Hundred "
Case 3: ValueName = inVal & " Thousand "
Case 4: ValueName = inVal & " Lakh "
Case 5: ValueName = inVal & " Crore "
End Select
End If
End Function
there r three functions and some dicleration just copy and paste in ur form
and gust pass ur number in the funGetNumberInWords function u will find ur answer B Jp
|
|
|
|
|
when I'm in a textbox(big and multilined), and press Ctrl+T a textbox2(small box)must move beside the cursor(I mean the caret).
I used this
Dim caretPosition As Point = TextBox1.GetPositionFromCharIndex(TextBox1.SelectionStart)
but,
(it says "GetPositionFromCharIndex" is not a member of System.Windows.Forms.TextBox")
(I quess it's becuase I use vb .net(2003) version)
pls Help very urgent(this the third time I'm posting this).
|
|
|
|
|
I submitted a simple code the day before yesterday I think. Also Dave answered your question by saying that it was not possible to position the small textbox next to cursor inside the big textbox.
I think you should better think about some other alternatives like you can position the text box on top of big textbox's left corner or when you press CTR-T a popup window can display the small textbox.
Sorry...
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
I don't want it inside the textbox.. (for the third time)
I just want it beside the caret(I need a code for the caret position).
Why can't anyone understand such a simple question?
(and the code you gave me is for cursor/mouse position-It's Useless)
pls anyone know a code for getting the caret position?
I used this
Dim caretPosition As Point = TextBox1.GetPositionFromCharIndex(TextBox1.SelectionStart)
but,
(it says "GetPositionFromCharIndex" is not a member of System.Windows.Forms.TextBox")
(I quess it's becuase I use vb .net(2003) version)
|
|
|
|
|
Hí Nanco,
Everyone did apparently understand your question, but you don't seem to understand their answers:
NANCO wrote: Dim caretPosition As Point
is a point somewhere on the screen.
NANCO wrote: GetPositionFromCharIndex
is a position in the text in the textbox.
A point on the screen and a position in a string are not the same, and can not be connected the way you tried.
NANCO wrote: caret(I need a code for the caret position). and the code you gave me is for cursor/mouse position-It's Useless
caret = cursor, so not at all useless for what you say you are trying to accomplish.
So... if you need to show a textbox for the user to enter extra information, you can either just use an Input box, or really only create a textbox and mess around with postions and the topmost property, or you can just create a popup form the size of the textbox you want, and position that anywhere you like.
Or... are you trying to do something else entirely?
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Johan Hakkesteegt wrote: caret = cursor
Nope... caret is that blinking thingy you see in a text box, a cursor is a mouse pointer.
|
|
|
|
|
Yes, and the caret is also very often referred to as the cursor (however incorrect it may be).
So are you trying to solve your problem, or did you post this problem three times to prove a point about the English language? In that case I suggest trying a different forum.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Johan Hakkesteegt wrote: did you post this problem three times to prove a point about the English language
It was not my problem...
How did you come to the conclusion that NANCO and ChandraRam are the same?
|
|
|
|
|
My apologies to NANCO for not paying attention.
Now did you have anything constructive to add to this conversation ChandraRam?
My advice is free, and you may get what you paid for.
|
|
|
|
|
i have created a database for capturing the Applicants cv details. how do i develop the search facility to retrieve filtered records that match the specified search parameters specified.am using vb6.0 objects and sql2erver2000.
any one please assist
wizyman
|
|
|
|