|
First one Open File and Read the file by line wise.
Then By using Trim ,LTrim ,RTrim ,Left,Right,Mid,Instr,Space,Format Function you can get a real Output.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
|
I guess you didn't read his reply, so why did you thank him for it ?
I think you need to use recursion, or just keep count of how many times in you are, and add 2 every time to the number of spaces to remove. Or, just count the number of spaces and cut it down to always the same number. Perhaps with a regex.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
|
That thanks was for the time he spent to look my post...
Im not sure how to use this code to perform recursion...
CODE:
l = name.IndexOf(".")
If name.Contains("Groupe") Then
Grp = True NbOfSpaces = NbOfCar(name, " ") + 2
ElseIf Grp And NbOfCar(name, " ") = NbOfSpaces Then
name = (name.Substring(0, l) & Trim(comp) & name.Substring(l, (name.Length - l) - Nb) & desF.Insert(0, a) & desAF & desA & desAA & ecn & dnf & repDNF & repASM)
sw.WriteLine(name.Remove(0, 2))
Else
Grp = False
End If
Any help on this please...
|
|
|
|
|
Find string and Trim it. then Check if String Start By Grope then NotSAVEIT.
Best Regard
Anubhava dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Sorry, but I'm gonna have you add you to my personal list to avoid all of your future posts. Your repeated posts about the same question/topic for months on end gets old - esp. when many members have posted suggestions for you to try and you obviously are remiss in implementing them.
Some people just can't be helped - you're one of them.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
name = name.Substring(0,48).TrimStart() + new string(' ', 48-name.Substring(0,48).TrimStart().Length) + name.Substring(49);
It's an ugly way to do it, but that'll strip the leading spaces off the beginning of the lines, while keeping the alignment of later items. The better way to go would be to figure out what the Nom do modele is going to be, trim that, then attach the rest of the line for printing.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
I have a project I am using it in my local computer , when I tested my Database in a remote SQL server 2005 computer, it is giving error , while i can connect through SQL server installed in my computer to that SQL server instance and I can work on those Database I can not connect through VB.Net the code writen is as bellow it says to enable the TCP/pipe while both of them are enabled in remote computer.
con = New SqlConnection(" data source =\\servername\instancename; database = Employee;" & "uid=test; pwd=test")
|
|
|
|
|
If you have the servername right, then it's a network issue, or a configuration issue on SQL Server.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I am just a beginner so I could well be wrong here but I thought that; unless the remote server is on the same domain as the local machine then you are unable to connect to it by using a UNC? (i.e. \\servername) Is this incorrect?
Have you tried connecting to it by using its IP address?
|
|
|
|
|
|
Try Using This
data source=ServerName ;initial catalog=DatabaseName;persist security info=False;user id=DBUserName ;password=DBPassWord;Connection Timeout=600;
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
Ensure you have the SQL server configured properly, user/group permissions, and check the *firewall* on the server and client.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi
i am implementing VB.Net Windows Application. In that i have a datagridview. In that i displayed some records (let us say 10 rows with 12 columns, out of which 8 columns are datagridviewcheckbox columns.) from MySql database student table.
The values in the datagrid for each row are like this:
1,joseph, 5thclass, B, true, false, true, true, etc depending on the selection.
How to insert multiple records into a database table that are entered into a datagridview. With a single shot of Save all the records in the datagridview should be inserted in new table using Vb.Net . Can any one help me in this regard.
Any help appreciated
Thanks in advance...
|
|
|
|
|
At first you declare a Datatable Then Innsert Your Data into that DataTable and at last Set DataGridView.dataSource=Datatable
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
I am trying to create a VBScript which will accomplish the following:
1. Run ONLY if it's within an IP Address range
2. If it is, run Robocopy to copy Documents and Settings to a network share
3. The destination folder is the user name used to log into the PC
4. Run at a certain time of the day
Any help is greatly appreciated...
Ray
|
|
|
|
|
So what part of this are you having problems with??
|
|
|
|
|
Hi!
I want to retrieve multiple selected rows in true grid (VB6). I did found some atricles after Googling but they are blocked due to my companies internet surf control. Please provide the code for the same.
Many thanks in advance.
Don't Quit
|
|
|
|
|
Isn't TDBGrid a Delphi control?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi! I'm not sure about that. But I'm using it in VB6
Thanks
Don't Quit
|
|
|
|
|
Hi all I just have a question about the report progress on my background worker. Can anyone tell me what I am doing wrong with this code.
The problem I am having is the result window textbox2.text from my Sub BackgroundWorker3_ProgressChanged only shows some of the stream the last part of the stream is not displayed so I am guessing I am missing something to display the rest of the stream?
<code>
'Start NSLOOKUP
Private Sub NSLookupToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NSLookupToolStripMenuItem.Click
With Me.BackgroundWorker3
ToolStripStatusLabel1.Visible = True
ToolStripProgressBar1.Visible = True
ToolStripProgressBar1.Style = ProgressBarStyle.Marquee
Me.Cursor = Cursors.WaitCursor
.WorkerReportsProgress = True
.RunWorkerAsync()
End With
End Sub
'Start Do Work process
Private Sub BackgroundWorker3_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker3.DoWork
Dim lookup As Process
lookup = New Process
With lookup
.StartInfo.FileName = "nslookup"
.StartInfo.Arguments = TextBox1.Text
.StartInfo.UseShellExecute = False
.StartInfo.CreateNoWindow = True
.StartInfo.RedirectStandardOutput = True
lookup.Start()
Dim outputReader As StreamReader = .StandardOutput
outputReader.ReadToEnd()
Do While Not outputReader.EndOfStream
Loop
BackgroundWorker3.ReportProgress(1, outputReader.ReadLine)
End With
End Sub
'Start Progess of Process/Stream Output
Private Sub BackgroundWorker3_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker3.ProgressChanged
TextBox2.Text = e.UserState.ToString
End Sub
'End BGW
Private Sub BackgroundWorker3_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker3.RunWorkerCompleted
Me.Cursor = Cursors.Default
ToolStripStatusLabel1.Visible = False
ToolStripProgressBar1.Visible = False
MsgBox("NSLookup Complete")
End Sub
|
|
|
|
|
krazyazkid wrote: outputReader.ReadToEnd()
Do While Not outputReader.EndOfStream
Loop
BackgroundWorker3.ReportProgress(1, outputReader.ReadLine)
This is nonsense. ReadToEnd() reads everything, and returns it as a string, which you ignore.
Then you loop for the end, which you already reached. Then you read a line, which isn't there.
I suggest:
1. you read the documentation on StreamReader class
2. clean up your code
3. when problems exist, publish your code using the "code block" button (i.e. PRE tags) so it is formatted and readable.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks for the tips this is my first project using vb 2008 express I apologize in advance for not understanding the whole process yet, I will do some more reading on the stream reader.
|
|
|
|
|
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|