|
ad3z wrote: But accessing data such as Excel databases, can decrease performance if it is called
by an external application.
Another thing that also i personally find in VBA, is that it is very memory intensive and
that may effect the speed of the data processing.
I am "not really" using a database. Rather, I am doing alot of mathematical calculations and storing some of that data in re-sizeable arrays. So there is alot of memory access going on. The main reason that I am using VBA under Excel is for two reasons:
1. The ability to display nicely arranged data in the spreadsheet
2. The charting functions
As for the number of calculations, it is basically a binomial tree[^] structure with a maximum of 4000 levels. Thus I calculate 2 levels of the tree to 4000 levels inclusive so the number of calculations is basically a sum of 4000 to 2 inclusive: 4000+3999+3998+...+3+2. In other words, it's ALOT. I think the majority of the slowness is due to the arrays I am using. I really have two options:
1. Offload the processing to a DLL and solely use Excel for the charting
2. Re-write the code in C#. I'm actually going to do both at this point to see the results and, just maybe, write a CodeProject article about it comparing the two approaches.
We'll see.
Thanks for the reply!
"Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next.
|
|
|
|
|
I'm developing a project of collecting email id and storing them in the database and to support POP and SMTP service. For that I want to know how to send email from VB to SSL supported site?
Subham Rakshit
Software Developer
|
|
|
|
|
I have a form with a variable that is a custom object. I would like to bind certain controls (text and combo boxes) on my form to properties of the object. Thus if the user changes the value of a text box the corrisponding property of the object is updated. How might I bind a control to a property of the object?
Cheers
Visual Studio .Net 2005
|
|
|
|
|
|
Hi
I have made one quiz application with 3 forms and first one is just users name and then user need to click on button so next forms appears on screen,But the first form also remains on screen i tried with myform.hide and it's works but when user finish the quiz then it's shows me error
So how can i solve this problem,This is what i have done
And if i dont use myform.hide and if i close form first then all quiz closes
<br />
Private Sub btnType_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnType.Click<br />
Address = StrConv(txtName.Text, VbStrConv.ProperCase)<br />
Dim MyForm2 As New frmSQuiz<br />
If Trim(txtName.Text) = "" Then<br />
MsgBox("Please enter your name", MsgBoxStyle.Exclamation, "Error")<br />
Exit Sub<br />
Else<br />
MyForm2.Show()<br />
MyForm2.ActiveForm.Text = "Well Come " & Address & " to Type - In - Answer Section ...."<br />
txtName.Text = ""<br />
btnType.Visible = False<br />
btnMultiple.Visible = False<br />
End If<br />
End Sub
any help
|
|
|
|
|
Don't make your login form the Startup form. The main form of your application should be the start form. When it starts, it should check to see if a user is logged in and, if not, show the login form.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
First of merry x-mas sir
And thanks for your rep.
I understand ur point and i tryed it but it's starts application without logged in so wr do i need to wright that code b cos i am new in vb.net sir
And this code is for first form
Private Sub frmQuiz_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Time = Now<br />
lblTime.Text = Format(Time, "d MMMM yyyy")<br />
btnType.Visible = False<br />
btnMultiple.Visible = False<br />
End Sub<br />
Private Sub btnStart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnStart.Click<br />
Address = StrConv(txtName.Text, VbStrConv.ProperCase)<br />
If Trim(txtName.Text) = "" Then<br />
MsgBox("Please enter your name", MsgBoxStyle.Exclamation, "Error")<br />
txtName.Focus()<br />
Exit Sub<br />
Else<br />
btnType.Visible = True<br />
btnMultiple.Visible = True<br />
End If<br />
End Sub
so please help me with this
wating for your kind rep.
|
|
|
|
|
You're going to have to reorganize this code. In your Form_Load, you can setup your applications basics and check for a user being logged in. You'll have to put something together to keep track of the users login, maybe an ID or a username.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Perhaps, set your application to not close when startup form closed, this can be found in the project properties (go to project on the main menu and select properties). Then you can say myform.close , closeing the login form once the other form is opened.
Posted by The ANZAC
|
|
|
|
|
Hello
Thanks for your kind rep.
But i could not fine that type of property in project property so can you please kindly tell me how can and which property do i need to change
I checked main project property but still i have no idea what to do
thanks
wating for your kind rep.
have a nice time
|
|
|
|
|
Hello Again
Thanks both of you sir
I have done it, I create my own sub main and then I call application.run() and same in application.exit(), so i just wanto know that is this the right method or not ?
I realy thankful to both of you Dave Kreskowiak and The ANZAC
Thank you very much
byyyyyyyyyyyyyyyy
|
|
|
|
|
It just won't work for me!
If I use:
Me.LayoutMdi(MdiLayout.TileVertical)
Or even:
Me.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal)
But the tiling is a mess. Either method, I get similar results:
- two columns (three would fit more than comfortably)
- Huge gaps between the forms
- Except one column where Forms vertically overlap to fit them all in the MDI (even though autoscroll is True)
The code from the Horiz Menu choice is:
Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TileHorizontalToolStripMenuItem.Click<br />
<br />
Me.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal)<br />
<br />
End Sub
(Cascade works just fine.)
The Forms' properties are:
Autosize = False
MaximizeBox = False
MaximumSize = 168, 406
I don't want them to resize. They must remain 168,406. I had awful-looking results when I did not restrict their dimensions and they stretched out.
Can you think of any way around this? Rearranging them manually is untidy, especially as there is no "snap to grid" feature available either.
Can anyone help?
|
|
|
|
|
The Tile function of LayoutMDI depends on the child forms being able to resize. Tile willevenly divide up the MDI space between all the forms, then place and resize all the child forms appropriately. It does NOT consider the Maximum size properties of the children when dividing up the space.
If you want this to look good, you'll have to implent your own code to tile the child windows, taking into consideration the maximum size of the child forms. It shouldn't be very hard, it's just a little math problem involving division. You'll have to calculate the position of each form based on the maximum size that, for ease of placement, should be the same for all your child windows.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks, Dave.
Pity it won't work the automatic way for me.
I will sit down and energise the brain cells for this one! It will be an interesting challenge, like some of the other ones I have faced in this project.
|
|
|
|
|
Hi .
Can anyone tell me if it's ok to write app settings like company details , logged in users , tax/vat variables . basically im wanting to find out if its ok in terms of it still being a secure location.
Thanks.
Robbo
|
|
|
|
|
vbbeg wrote: basically im wanting to find out if its ok in terms of it still being a secure location.
What made you think it was a secure location in the first place? The answer to your question depends on what you mean by "secure"? Are you looking to store encrypted or plain text data there? What are you doing with this information?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi dave.
at the moment im thinking of storing plain text. my app runs mdb database and i wanted to store variables and strings saved in app settings such as
user logged in to app , tax/vat variables. i also planned to write these settings to a file which can be restored to registry if needed be. what advise can you offer on this. is it ok for me to do so and is it consider ok
practise for an app.
Thanks Dave.
Robbo
|
|
|
|
|
From your description, you don't need to store any of this stuff to the registry. Applicaiton settings should be stored to a file in the users Application Data folder in their profile. You also don't need to store them in two different places. This will only create extra work that's unnecessary.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave.
Thanks I think you've confirmed and answer my question. just to confirm with you. the application settings are what the user needs to setup before using app. for example. This is a invoicing app and the user has to enter the following.
- invoice number (where they want their invoice numbering to start from)
- tax/vat (the tax or GST as wel call it in australia)
- delivery charge rate
- discount /specials rate .
so if im to store these in the user APP DATA FOLDER. can you just tell what i should be saving into in terms of FILE AND FORMAT etc. what do u recommend.
I mean do others apps also store these kind of settings in users APP DATA FOLDER. I would like to practise the standards of such programming.
Thanks again. I really appreciate you getting back to me on this
Robbo
|
|
|
|
|
The usual now-a-days is an XML file. Easy to maintain and edit...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thankyou Dave.
I will take what advice you've given me. I'm assuming it should be ok to store XML file in APPLICATION STARTUP PATH aswell.
Cheers.
Robbo
Robbo
|
|
|
|
|
Yes, in most cases. Placing it there will have the same settings for the app for every person who runs it on that machine.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks Again Dave.
I feel pretty bad to ask one more thing and can appreciate you assisting many others like myself but if possible are you offer any advice or good material for creating invoice printing for VB.NET without any report utilities like crystal reports. I would like to do it in VB.NET only without any report addins.
I honestly can't thankyou enough.
Robbo
|
|
|
|
|
Well, it's a PITA. You basically have to create you own print document and paint the data into the appropriate places on the (blank) page so they just happen to fall into the boxes on the form. This will take CONSIDERABLE trial and error to get the placements correct. You can come up with a system that accepts an offset (X and Y) from the top left corner to place each field. You then save each of these offsets to a file so you can reload them later. It's not too difficult to do, just a royal PITA to lay it all out correctly. I've seen the same thing done with fingerprinting systems (law enforcement) that print fingerprint cards to send to the FBI.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am using VB 2005 Express Edition and i am trying to deploy\Publish my porgram and i can publish it with no problem but when i go to run the program outside the VB environment it crashes. Anyone can tell me or direct to a sort of step by step so i can make sure i did it right?
thanks
Is the .NET framework installed on the target machine ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
Crashes with what error message?
Dave Kreskowiak
Microsoft MVP - Visual Basic
I am trying to run the program from the server and i know that the computer has the framework, i cant say that the erver does with absolute certainty, but i will check into that. The error i get is the standard "windows has encoutered a problem with this program, and it must be shut down"
Microsoft Error Msg
Code: 0xe0434f4d
Flags:0x00000001
Record: 0x0000000000000000
Address: 0x000000007c59bc3f
thanks for responding
|
|
|
|