|
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.
|
|
|
|
|
Hello,
I would suggest you to add reference for the System.management class in your project and I hope that following code will return the free physical memory
Dim freeMemory As New ManagementClass("Win32_OperatingSystem")
Dim memory As ManagementObjectCollection = freeMemory.GetInstances()
Dim memEnum As ManagementObjectCollection.ManagementObjectEnumerator = memory.GetEnumerator()
memEnum.MoveNext()
MessageBox.Show("Physical memory total space is: " & Format(Integer.Parse(memEnum.Current.Properties("FreePhysicalMemory").Value) / 1024, "#,### KB"))
I hope this helps.
James Smith
James Smith
www.componentone.com
|
|
|
|
|
I'd like to know can i print something that is in textBox or a listBox.
example of code:
dim output as String =txtInput.text
txtDisplay.text = output
I do i print this out? Thanx
Faruzzy.net!
|
|
|
|
|
Hello,
To print the text in a textbox, you would have to use the PrintDocument object. Using the
PrintPage() event for this object, you can set the printing preferences and the text to be
printed.
Lets say, you have a Textbox and a Button placed on a form. Drop a PrintDocument object on
the form from the toolbox.
In the Button_Click event, write the following code:
Me.PrintDocument1.Print() ' PrintDocument1 is the name of the PrintDocument Object.
Now in the PrintPage() event for PrintDocument1 object, place the following code:
(You can double click on the PrintDocument1 to get to the event)
Dim control As Control = TextBox1 ' you can change this to control of your choice
Dim myfont As Font = control.Font
Dim mybrush As New SolidBrush(control.ForeColor)
e.Graphics.DrawString(control.Text, myfont, mybrush, 12, 12)
mybrush.Dispose()
I believe this should help.
Regards,
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Hi, Can someone please tell me how i can use an hovergradientButton, it seems that i have to import a class from the library or something like that, since i cant see that button in my toolbox...
Faruzzy.net!
|
|
|
|
|
Your best source of information on using a third-party library is the manufacturer of the library itself.
But, generally, you add a reference to the .DLL file that's supplying the library, then import the namespaces you need to use whatever classes you need.
For controls, you can add them to the ToolBox by right-clicking a tab in the ToolBox (while you have a form window open) and picking "Choose Items...". In the dialog that shows up, you click the Browse button and go find the library .DLL file and open it. The rest should be obvious.
|
|
|
|