|
I have created a project of approx. 4400 lines of code (I used the project line counter to check it )
It looks great, but it is slow when I first click on a button in my program, to logon a user on a computer. (I created a cyber cafe management program)
I also created a sample of this project in C# and it seems faster there.
Is it possible that VB.NET delivers slower code than C#?
I know it's not possible in theory since it's all IL, but still...
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
Hi again,
When I stick the AxMsFlexgrid1 on to my form and when I run it, It just displays the form witout the datas in it,
If I remove it then all the datas appear on the form.
Like I am populating my combobox1 from the data set.
When I have the flex grid on my form the combox comes up empty.
But if I remove the Flex grid the combobox is populated from the data set.
What am I missing?
Tnx
|
|
|
|
|
Hi all,
Can some one help me as to why I am getting this error mssg?
@ da.SelectCommand.CommandText = "select orig,ordno,name,chkno,blno,state,adr1,orddt,txble,txcrt from cshhdrpf where orig = " & arr(1) & "and ordno = " & arr(2)
Error Mssg:
Additional Information: Index was outside the bounds of the array.
Dim arr As array
arr = Split(cmb1.Text, " - ")
Dim da As New OleDbDataAdapter()
Dim ds As New Data.DataTable()
da.SelectCommand = New OleDbCommand()
da.SelectCommand.Connection = conn
da.SelectCommand.CommandText = "select * from Test1 where orig = " & arr(1) & "and ordno = " & arr(2)
da.SelectCommand.CommandType = CommandType.Text
Tnx
|
|
|
|
|
Just like the error message says... The index 1 or 2 doesn't exist in your arr array.
You're either not splitting your cmb1.Text text with the correct splitter or you're not getting the result you expect. Try stepping through the code and see what arr = Split(cmb1.Text, " - ") is actually returning.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I want to learn VB, but do not have access to Visual Basic, nor the funds to get hold of the s/w. I would be grateful if anyone could suggest a free software similar to the M$ version.
Downloading is not a problem. Hope to listen from you soon.
Regards,
Ajit
"Insanity is my Birth Right!!!!"
|
|
|
|
|
Ajit Jagannath wrote:
I want to learn VB, but do not have access to Visual Basic, nor the funds to get hold of the s/w. [...] Downloading is not a problem.
Downloads are no problem? Then this is for you!
Visual Basic 2005 Express Edition Beta[^]
Best regards
Dennis
|
|
|
|
|
how can convert textbox value to double?
|
|
|
|
|
<br />
Convert.ToDouble(yourTextBox.Text);<br />
Remember to catch exceptions as this function will throw one if it the text cannot be converted.
|
|
|
|
|
Try this:
Dim d As Double = Double.Parse(txtFromDate.Text)
The function Double.TryParse() also may be usefull.
----------------------------------------------------------------------
T Manjaly
My C# Tutorials articles www.dotnetspider.com
|
|
|
|
|
Hi, I found the sample of vb6 and mschart control from here.[^] I want to know, is it possible if I use this mschart control in VB.Net application????
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Yes you can (like any other COM control. Open up a form, right click into your toolbox, select add/remove items, click the COM tab, search for 'Microsoft Chart Control...', check it and click ok. Now you can drag drop it like any .Net control onto your form.
Depening on what you are trying to do you should search for some .Net charting controls. The MS charting control is not really bad but has many slight flaws and also some stranges issues. Some chart controls for .Net are freely available here on CodeProject.
|
|
|
|
|
Robert Rohde wrote:
Yes you can
Ok, thank you very much for your information. I will try to do in VB.NET.
Robert Rohde wrote:
The MS charting control is not really bad but has many slight flaws and also some stranges issues
That is the main point that I always consider when I try to use COM object in VB.NET. So is it possible to do some basic task in VB.NET??? And can you tell me what is the main issue???
Robert Rohde wrote:
Some chart controls for .Net are freely available here on CodeProject.
If it is possible, please give the URL to me. I try to find most .Net chart control but it is available only in ASP.NET application. I want to use .Net chart control in windows form but it is not possible to find it. I will try to find myself too and let you know.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Sure it is usable and depending on what you want to do it can be a very good control. The main reason not to use it (for me) was that some (very special) behaviour could not be altered.
A good chart control on CodeProject can be found at:
http://www.codeproject.com/csharp/ZedGraph.asp
If you look fpr something really professional (which also costs a bit) take a look at Dundas Charts:
http://www.dundas.com
|
|
|
|
|
Thank you very much for your information. I already check some part of this article and found that the code is written in VC.Net. Is it possible to write it in VB.NET??? If possible then I might use this control instead of Mschart.ocx control.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
This isn't related to VB but to this forum. How do I post code in the forums where it retains the format. The <code></code> tags don't seem to do what I expect them to do.
|
|
|
|
|
OICU812 wrote:
How do I post code in the forums where it retains the format. The <code></code> tags don't seem to do what I expect them to do.
Use the the pre tag instead [<pre>many lines of code</pre>]. It then will look like this:
public void Foo()
{
}
Best regards
Dennis
|
|
|
|
|
Thanks! Makes a big difference.
|
|
|
|
|
Could someone please lend some assistance to an issue which I expect is simple but eludes me at the moment. The following description is a simplification of what I am trying to do.
I have a collection called PartsCollection which has an Area property which is the sum of the area properties of each object in the collection.
Each object is called PartObject and has Width, Height and Area properties. When width or height is changed the area is recalculated.
I wish to have the PartsCollection.Area property update when either PartObject.Width or PartObject.Height is changed for any object within the collection.
I was thinking of PartObject raising a Changed event and having an event handler for this event in the PartsCollection class. I can't figure out how to wire the handler to all of the objects in the collection.
I trust this description is not too cryptic.
Cheers, in advance
Tim
|
|
|
|
|
Your are looking for the AddHandler and RemoveHandler keywords. They are used to bind and unbind eventhandlers dynamically:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmAddHandlerStatement.asp
With it you can attach events when an item gets added to your collection. But dont forget to remove your eventhandlers when an item is removed (eg. with Remove, RemovAt, Clear...)
|
|
|
|
|
I've been working on a similar problem and I handled it with Delegates. I made an example using your class descriptions to test my knowledge of delegates. I'm no expert here but this will do what I think you are looking for.
'The delegate that handles the communications between classes.
Public Delegate Sub AreaChangedHandler(ByVal sender As PartObject)
Public Class PartsCollection
'simplified collection
'not intended to demonstrate a true collection class
Dim m_collection As New ArrayList
Dim m_Area As Double
Shared Event AreaChanged As AreaChangedHandler
Public Event PartAdded(ByVal part As PartObject)
ReadOnly Property Area() As Double
Get
Dim obj As PartObject
Dim totalArea As Single
For Each obj In m_collection
totalArea += obj.Area
Next
Return totalArea
End Get
End Property
Friend Sub Add(ByVal part As PartObject)
m_collection.Add(part)
RaiseEvent PartAdded(part)
End Sub
Shared Sub OnAreaChanged(ByVal sender As PartObject)
RaiseEvent AreaChanged(sender)
End Sub
End Class
Public Class PartObject
Dim m_Width As Single
Dim m_Height As Single
'Shared delegate that invokes OnAreaChanged method in PartsCollection
'without having to create an instance of PartsCollection
Private Shared delegateAreaChanged As New AreaChangedHandler(AddressOf PartsCollection.OnAreaChanged)
Property Height() As Single
Get
Return m_Height
End Get
Set(ByVal Value As Single)
m_Height = Value
Call AreaChanged()
End Set
End Property
Property Width() As Single
Get
Return m_Width
End Get
Set(ByVal Value As Single)
m_Width = Value
Call AreaChanged()
End Set
End Property
ReadOnly Property Area() As Single
Get
Return m_Height * m_Width
End Get
End Property
Protected Overridable Sub AreaChanged()
delegateAreaChanged.Invoke(Me)
End Sub
End Class
|
|
|
|
|
Hi!
i want to export data from Datagrid or (Dataset) in Excel or (CSV) in windows forms using Visual Basic .net
will someone guide me?
|
|
|
|
|
If you type 'excel' and 'export' into the search field of CodeProject you get several hits to start off:
http://www.codeproject.com/info/search.asp?cats=3&cats=4&cats=5&searchkw=excel+export&author=&sd=11%2F15%2F1999&ed=1%2F1%2F2005
They are mainly in C# but even if you you dont know C# at all you should be able to convert it to VB.Net by yourself.
|
|
|
|
|
Hi,
Wishing you all a very happy and prosperous new year.
I state my problem ,
My server socket looks for data from connected clients.
When a data is found it is stored in a file for further processing.
It's all happening but the first command being recieved from any client is being ignored as the server is just checking for a particular command.
Imagine the scenario ...i sent the data via the code:
Winsock1.SendData strTemp
in the server file it comes like
oÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌtÿÖperator play anil.pcm 2001
Though the second command onwards comes as is sent.
This has become a real headache to me..i dont understand how to get read of it.
Awaitng a quick reply
Thanks in advance.
amit mishra
|
|
|
|
|
I have an old OCX written several years ago (in C?). I have re-written this in VB6. It works fine, but the GUID is different to the original.
How can I make the GUID the same as that in the original OCX ?
|
|
|
|
|
what is a simple call to put into a click event to make sure the application fully terminates
VB 6.0 application
thanks
|
|
|
|