|
Hi,
What I suggest is opening two textstream objects, one for each file, then simply read line by line comparing the fields with functions such as INSTR and MID etc.
Regarding homework.
My take on the area is that if someone has not made any effort to google it search in the archives of Code Project; then whether it is homework or not I'm not usually prepared to help, because as all experienced programmers know the only way to break into programming, as a career, is to have taken the initiative in ones learning and gone beyond asking for help as soon as one hits a wall.
You always pass failure on the way to success.
|
|
|
|
|
Thanks for the idea and advice. But the prob with that method is the lines might be diff in both the files. I mean The first lines might not fields at all in both the files. So I will have to compare only the FIELDS.
|
|
|
|
|
Hi Ravi,
I don't understand so can you give me an example.
Thx
You always pass failure on the way to success.
|
|
|
|
|
If order is irrelevant and other lines might be present, this is what I would suggest:
read one file and build a Hashtable/Dictionary with field-value pairs;
then read the second file and build a second HT/Dict, then compare both.
Optimization: rather than building the second HT/Dict, you could search the first one
and remove as you find; in the end everything should be found and removed to be identical.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I have an Windows Application(Developed in VB.net) in Windows Vista which sends an email using Outlook 2007. We can enter the text for the email in a form in the Windows application.First a word document is prepared using a 2003 word template and then this document is included in the email using vb.net (.net 2.0) office automation.
Now the problem is if there is more than 1 space in the text it appears as �
(Unicode Replacement Glyph) in the outlook word editor and therefore appears in the mail as well.For 2 spaces 1 � appears and for 3 spaces 2 � appear.For a single space there is no problem.
Can anybody suggest any solution or at least tell me why this may be happening? This character should not come in the mail generated.
PS: This application sends an email without any issues in XP(where automation is done using .Net 1.1 and Office 2003).It was migrated to .Net 2.0 for use in Vista
rahul
|
|
|
|
|
I am a newbie, be gentle.
I am starting out with basic File I/O and have seen an example here on 'The Code Project' (TextFileImporter) that uses a data table classto hold the data and then display it in a grid via a dataset.
I want to temporarily store the data whilst parsing each line and validating but ultimately don't want to display the data in a grid.
Is it common practice to still use a data table in VB.NET or should i use an array or string as in the VB6 style.
Thanks
Barney
|
|
|
|
|
Good question.
There are different answers depending on what you want.
If you want ease of programming then a datatable is a good choice. This is because it uses rows and columns with which you are probably familiar.
If you want speed of processing then I would recommend an arraylist.
Arraylists are faster to read and write to, in my experience, than arrays. The catch is that arraylists are not multidimensional.
The good news is that there is a way around this problem i.e. how to represent rows and colums in an arraylist.
I use arraylists in a csv class I created and they whack the pants off arrays when it comes to processing speed.
Alternatively you could use a dataview.
What this does is basically make a view of your table.
So that it contains the same data.
The advantage of a dataview is that you can very easily apply sorts and filters.
Also with a dataview all you basically do is point the dataview object to your table et voila you have another way of looking at your datatable.
I hope this is of some help to you.
You always pass failure on the way to success.
|
|
|
|
|
Thanks, i think i'll opt for the data table for now then, just to get up and running as i'm only dealing with reasonably small files.
For larger files though i'll consider arraylist.
Many Thanks
|
|
|
|
|
Presently i am using the context menustrip for showing popup menu for dynamic controls when i click on textbox it is showing the defualt rt.click properties . I want to show the Custom Context MenuStrip properties .It is showing both properties . How to disable the predefined properties???
Waiting For Help....
DVSriram
|
|
|
|
|
Is this possible to show .gif file in status bar by vb.net 2003?
Thanks In Advance
Ejaz
|
|
|
|
|
You can't show a file in the status bar. Load the file into an Image object, then it's possible to show it.
If you are using framework 2, use StatusStrip instead of StatusBar. Add a ToolStripStatusLabel to the bar and assign the image to the Image propery.
---
single minded; short sighted; long gone;
|
|
|
|
|
hi, really need to know how to add the reference lybraVb.dll, so that i can use hoverGradientButton.
Faruzzy.net!
|
|
|
|
|
Do NOT post the same question multiple times in the same day. Show some patience. You posted your question while most people, who answer questions on these board, were asleep.
If you want help THAT bad, call the people who wrote the library and pay them whatever they want to support you.
|
|
|
|
|
Hi, I have develop an application in vb2005 and want to produce the report in crystal report. From here, does anyone know how to display a report in crystal report (which integrated with vb2005) with a dynamic coding?
Thank in advance
|
|
|
|
|
Hello,
To include the report on the Web page, we need to drag and drop the Crystal Report Viewer control from the Toolbox. Because the Crystal Report Viewer control doesn't have a ReportSource property available at design time, you have to set that property inside your code.
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer
#Region " Windows Form Designer generated code "
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CrystalReportViewer1.ReportSource = Server.MapPath("crystalreport1.rpt")
End Sub
End Class.
or you can create instance of the report class which was created by Visual Studio.NET when you designed your report. The name of that file is same as report that you create CrystalReport1.vb. To see this file expand CrystalReport1.rpt (click on + sign in front of the CrystalReport1.rpt).
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer
#Region " Windows Form Designer generated code "
Dim crpt As CrystalReport1
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
crpt = New CrystalReport1()
CrystalReportViewer1.ReportSource = crpt
End Sub
End Class.
If you set WebForm1.aspx to be the Start Up page for the project, and start the project, you will get the report page if you have blank password in database for "sa". If "sa" or any other user name that you want to use to access database has password, when you run the report, you will see the "LogonFailed" error. If we were developing windows application, Crystal Reports will ask us for password information. This error occured, because when you design and save report, all of the connection information is saved within the report except password. If the password is blank, there will be no problem to create or generate the report.
To prevent this, you will need to provide login information in your code before you set ReportSource property. To do so, you will add some code in Page_Load event. Now, your code should look like:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer
#Region " Windows Form Designer generated code "
Dim crpt As CrystalReport1
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
crpt = New CrystalReport1()
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "test"
myLogin.ConnectionInfo.UserID = "sa"
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ReportSource = crpt
End Sub
End Class.
Now, if you run the report, you will not get an error page and evrything will look OK. The report will be generated and shown in your Web page.
Regards,
James
James Smith
www.componentone.com
|
|
|
|
|
Hi all
I have an application i want to delete tables from a word file with multiple columns
so i have to read the file
delete tables with multiple columns
The word file consist of both table and paragraphs. I want to delete tables which are having more than one column and save the content in a separate word file.
Regards
-- modified at 6:35 Wednesday 19th September, 2007
Prakash Mishra(Banglore,India)
|
|
|
|
|
How to transfer report from crystal report to excel using VB??
|
|
|
|
|
|
Hi friends..
Can anyone give me the code to get the memory status of a hard disk,,i.e i need to show the available memory space and used memory space..
Thanks & Regards,
Balaguru
|
|
|
|
|
this should help you on you'r way
My.Computer.FileSystem.Drives(0).AvailableFreeSpace
My.Computer.FileSystem.Drives(0).TotalSize
My.Computer.FileSystem.Drives(0).TotalFreeSpace
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
is there a way for me to force the string.replace() method, to replace the first instance of a substring rather than every instance?
There are 10 kinds of people in this world. Those who understand binary and those who don't...
______________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
|
|
|
|
|
Never mind.
I did it using Microsoft.VisualBasic.Replace().
I'm more than open to other suggestions.
There are 10 kinds of people in this world. Those who understand binary and those who don't...
______________________
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
|
|
|
|
|
Hello,
My query is related to application deployement.
I have created one application in vb.net and now want to deployment.
Suppose it requires 5GB of memory then in my setup project how can i check
physical memory required using launch condition.
Anyone who does know, please tell.
Thanks in advance.
|
|
|
|
|
I take it you mean 5GB of disk space or do you really mean 5GB of RAM?
You always pass failure on the way to success.
|
|
|
|
|
To be very specific, i have to check the disk space.
Thanks.
|
|
|
|