|
And your point is?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Wow - I've seen people write questions in articles, now it's articles in forums.
The answer is much shorter - VB6 is rubbish, and VB.NET is a real language.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
VB6 is great --- VB.Net is just greater.
Ask not whether it is useful. Ask what it is useful for.
|
|
|
|
|
Munna Sarfraz Ahmad wrote: But objects are still passed by reference.
Not quite.
Consider the following:
public sub sub1(byref x as collection)
x.add(45)
x=new collection
x.add(23)
end sub
public sub sub2(byval x as collection)
x.add(45)
x=new collection
x.add(23)
end sub
If 'x' is a collection, and I perform sub1(x), then x will now point to a new collection containing the value 23. If a reference to the old collection exists anywhere, the collection pointed to by that reference will now have contain the value 45. If x was the only reference to that collection, it will go bye-bye.
In the second scenario, when I perform sub2(x), then the collection pointed to by 'x' will have whatever it had in it before, along with 45. A new collection will be created and have 23 put into it, but that collection will go bye-bye sometime after the function exits.
|
|
|
|
|
i cant believe you bothered to read that!
|
|
|
|
|
Munna Sarfraz Ahmad wrote: The keyword SET is gone - Since everything in VB.NET is an object.
No, that's not the reason, because that is not true.
There is still a difference between simple variables (value types) and objects (reference types). A reference is however a value type, so whenever you make an assignment, you are copying a value type. As you can't assign the object itself, there is no use for the Set keyword.
Munna Sarfraz Ahmad wrote: We can also create a class destructor, which is equivalent to Class_Terminate event in VB 6.0, by adding a sub-procedure called Finalize to our class.
The memory management in .NET doesn't use reference counting, so the Finalize method is not a destructor. It's not equivalent to the Class_Terminate event. If you need to control the life cycle of an object, the class should implement the IDisposable interface.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi All,
I need a control that work like a Combobox, but accepted more than one selection like a Listbox control.
Someone help me?
Thanks,
|
|
|
|
|
Why not just use the listbox? is there some reason you dont want to use it?
|
|
|
|
|
Thank you Kevin,
Because I want a control that open a dropdown list when got the focus, and close it when lost the focus like a Combobox, but accepted more than one selection like a Listbox control.
|
|
|
|
|
Why not on the show the listbox when your textbox gets focus and hide the listbox when you textbox looses focus?
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Thank you Steve Jowett,
OK. It is a good idea.
But I have a little problem. My experience in VS User Control construction is very poor. So I'm looking for something already done. A VB or C# User Control that I can downloaded and put in my forms.
Thanks
|
|
|
|
|
Hi to all,
I am trying to dynamically create label controls on TableLayoutPanel control, so that i have wrote following code. but at the debugging time it will genarate all the lables, but it doesnt show that panel as output. I checked its visible property its always false.... any body know why this happened?
Public Sub fillTablePanel(ByVal ds As DataSet, ByVal TableName As String)
FormContent.TablePanel.Parent = FormContent
FormContent.TablePanel.Visible = True
FormContent.TablePanel.BackColor = System.Drawing.SystemColors.ActiveCaptionText
FormContent.TablePanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.OutsetPartial
Dim tRows, tCols As Integer
FormContent.TablePanel.ColumnCount = ds.Tables(TableName).Columns.Count
For tCols = 0 To ds.Tables(TableName).Columns.Count - 1
FormContent.TablePanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100 / (ds.Tables(TableName).Columns.Count)))
Next
FormContent.TablePanel.RowCount = ds.Tables(TableName).Rows.Count
For tRows = 0 To ds.Tables(TableName).Rows.Count - 1
FormContent.TablePanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100 / (ds.Tables(TableName).Rows.Count)))
Next
ReDim FormContent.lblHeader(ds.Tables(TableName).Columns.Count)
For tCols = 0 To ds.Tables(TableName).Columns.Count - 1
FormContent.lblHeader(tCols) = New Label()
FormContent.TablePanel.Controls.Add(FormContent.lblHeader(tCols), tCols, 0)
FormContent.lblHeader(tCols).Text = Convert.ToString(ds.Tables(TableName).Columns.Item(tCols))
FormContent.lblHeader(tCols).Location = New Point(FormContent.TablePanel.Location.X, 10)
FormContent.lblHeader(tCols).Visible = True
FormContent.lblHeader(tCols).AutoSize = True
Next
FormContent.TablePanel.Location = New System.Drawing.Point(221, 46)
FormContent.TablePanel.Name = "TablePanel"
FormContent.TablePanel.RowCount = 2
Dim x As Integer = ds.Tables(TableName).Columns.Count
Dim y As Integer = ds.Tables(TableName).Rows.Count
ReDim FormContent.lblContent(x * y)
Dim ctr As Integer = 0
For tRows = 0 To ds.Tables(TableName).Rows.Count - 1
For tCols = 0 To ds.Tables(TableName).Columns.Count - 1
FormContent.lblContent(ctr) = New Label()
FormContent.TablePanel.Controls.Add(FormContent.lblContent(ctr), tCols, tRows)
FormContent.lblContent(ctr).Text = Convert.ToString(ds.Tables(TableName).Rows(tRows).Item(tCols))
FormContent.lblContent(ctr).Location = New Point(FormContent.TablePanel.Location.X, 100)
FormContent.lblContent(ctr).Visible = True
FormContent.lblContent(ctr).AutoSize = True
ctr += 1
Next
Next
FormContent.TablePanel.Size = New System.Drawing.Size(386, 93)
FormContent.TablePanel.TabIndex = 5
FormContent.TablePanel.Visible = True
End Sub
Pravin
|
|
|
|
|
I have only used the flowcontrol and in that case I created a user control for each set of data, placed all the management for the cotrol inside the user control and loaded 1 copy of the user control per record into the flowcontrol. That strategy may be relevant to the table control!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
please i have upgraded a .net project from 1.1 to 2.0 the application is running but the refences hold yelloe flags even i added them again and the application is generating an error while in debugging mode and working normally if i double click the .exe file.
Thanks
Mohammad Al Hoss
|
|
|
|
|
Could you post the debug information or errors that occur when you upgraded. Theoretically their shouldn't be too many problems.
Regards,
Thomas Stockwell
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.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
|
Kumaran21cen wrote: using C#.net.
Wrong forum.
If you are using Stream to save the file, then Stream.Length can solve the purpose.
|
|
|
|
|
I hav created a project in VB.Net where i have to create a setup wizard dat should work only for 30 days or 15 days what i am suppose to do. if the trial period get's over they should not be able to reinstall the setup again.in that particular pc any body help....
|
|
|
|
|
Hello all,I am wondering anyone can guide me how to read tiny text column for MySQL using VB.NET Datareader.
The following are the code I used to read the column:
Public Function StartupData(ByVal strKeySet as String)
Dim test as string
Dim MyTinyText as string
Try
ObjComm = New OdbcCommand("SELECT SettingValue FROM pos_setting WHERE LocationCode='KK' AND SettingKey='ADD_BINLOG'", ObjConn)
ObjConn.Open()
ObjRead = ObjComm.ExecuteReader()
If ObjRead.Read Then
test = ObjRead.Item(0)
MessageBox.Show("This is " & test & "")
Else
MessageBox.Show("No value")
End If
ObjConn.Close()
Catch ex As Exception
Finally
Objconn.Close
End Try
And my database table as follow:
---------------------------------------------
Field Type Collation Null Key Default Extra Privileges Comment
------------ ----------- ----------------- ------ ------ ------- ------ ------------------------------- -------
LocationCode varchar(10) latin1_swedish_ci NO PRI select,insert,update,references
SettingKey varchar(10) latin1_swedish_ci NO PRI select,insert,update,references
SettingValue tinytext latin1_swedish_ci YES (NULL) select,insert,update,references
I'm wondering why its keep showing there is no data read inside the datareader? Actually there is a '0' inside the SettingValue for that row of data but I'm wondering why it doesn't read it? Anyone can give me a solution for this?
Thanks for reading~!
modified on Wednesday, May 28, 2008 6:59 PM
|
|
|
|
|
Do you need the Not in If Not ObjRead.Read Then ?
If you are only wanting to get one value you could use objComm.ExecuteScalar() instead.
|
|
|
|
|
I'm sorry,I forgot to remove the not while testing it. Actually I want to check if the row exist in the database,then it will do something. But eventhough it exited this row but it doesn't run. Can anyone give me a solution how to check the tinytext content in MySQL database column? Am I used the right way?
Thank you~!
|
|
|
|
|
You can still do ExecuteScalar(). If no matching row is found nothing will be returned.
You might want to consider using the MySQL .Net Connector[^]. It has MySqlDbType.TinyText as a database type.
|
|
|
|
|
I am writing an email program, which will send mails to a number of email addresses in one go. But at the same time i want to save all the outgoing messages in my outlook express sent items folder. I am able to send mails in a loop but don't know how to save them in the Outlook Express Sent Items folder.
Is there any way to achieve the above functionality. Any code added will greatly help. I am using VB.Net 2005.
Thanks in advance.
Sekhar
|
|
|
|
|
As far as I know, this can be done through IMAP only.
Since, .NET inherently does not support IMAP so you might have to search for a third party tool to achieve the desired scenario.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
I'm having trouble keeping my forms looking the same, or at least similar, across different computers (different versions of Windows; different monitor displays, etc.) Would someone be willing to point me in the right direction to solve this problem?
Thanks
|
|
|
|