|
I have no experience, I have never used Delphi, and I refuse to use VB.NET.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I used to work for a company that had all their code in delphi and turbo pascal. The company decided to move to vb.net. SO I have a bit of experience translating delphi to vb.net.
Things that will drive you crazy in vb.net
there are no ; for line delimiters. If you want a line to go to the next line you have to use _ When passing parameters you always have to mark the parameter as byref or byval. You have try catch instead of try except. Any use of pointers is probably not needed anymore. The database stuff is really different and takes some getting used to.
I think the biggest issue is just learning the .net framework. That takes a while. Once you get familiar with it, it doesn't matter if you write the code in vb.net or C# because you know the .net framework. I wrote a little document at one point that talked about common things done in delphi and how to do them in vb.net. I will check to see if I can still find that doc.
Hope that helps.
Ben
|
|
|
|
|
That certainly helps a lot, thanks.
Did you use any tools that could automate atleast some part of the process?
I have come across this[^] tool that converts Delphi forms to Winforms.
That document would be great.
All in all, was that a good/painful experience and did you get the expected benefits in terms of higher maintainability ad improved performance?
I am sorry to raise so many questions, but I am trying to collect as much data as possible.
Thanks
Shreekar
|
|
|
|
|
We did not use any automated tools. In our case the way you do things in .net is different enough that it was probably a good idea to re-write the existing delphi code to better match the new .net structure.
I have looked for that document, it looks like I didn't take a copy of it when I left my previous employer.
It was a good experience to move to .net. Some of the issues we were facing were a lack of people we could hire that had delphi skills. The reality is that there are far more .net programmers out there then delphi. Now that I have been doing .net for 5 or so years, I wouldn't go back to delphi either. I really liked delphi as a product, but it tends to be a little behind the microsoft release. I still remember about 10 years ago where we had to wait almost a year before we could use ado in delphi. Now that delphi has .net that could always perhaps be an option too. Again you don't have a lot of people that will say they know delphi .net
The company I worked for went with vb.net and left delphi behind. I havn't worked there in 2 years, but I would guess most of their delphi code is gone.
The .net framework is great, I think it would be a good move to get on .net
Hope that helps.
Ben
|
|
|
|
|
setup and packaging a windows application using setup wizard or setup project options.
thank u
|
|
|
|
|
I don't see a question ? I mean, it's implicit, but it's kind of rude that you didn't really ask.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
hi,i am David Lau.
now i am doing a windows forms application. Yesterday, the customer gave us the following error. this error can repeat on that pc, but we do not repeat it in our test machine.
why does this error happens? who can help me?
■env:
・Win2000 SP4
・.net framework 1.1
・DB-Microsoft Access 2000
・VB.NET 2003
■Error infomation:
2007-04-13 16:45:02,476 System.Data.OleDb.OleDbException: Unknown
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at MIGRATE.ADP.RunSqlFillDataTbl(String strSql, DataTable& dtTbl)
--- ------- ---
at MIGRATE.ADP.RunSqlFillDataTbl(String strSql, DataTable& dtTbl)
at MIGRATE.frmMigrate.sbInitComboBox()
at MIGRATE.frmMigrate.frmMigrate_Load(Object sender, EventArgs e)
■Comment
(1)on that PC, MS Access is not installed
(2)MADC 2.8 has been installed.
Thanks.
David Lau
stillicel@hotmail.com
-- modified at 1:55 Monday 16th April, 2007
|
|
|
|
|
just update ur clients windows 2000 w/ sp4 or the latest sp release of microsoft.......
start a new beginning in every ending; thats what life for......
|
|
|
|
|
It looks like you trying to execute a Command against the database, but it's failing for an unknown reason. There's probably a couple dozen possibilities for this failure, but without any further information about what going on in the code at the time or what the SQL command is that it's trying to execute, it's just about impossible for anyone to tell you anything helpful.
Access does NOT have to be installed for this to work. You only need the MDAC.
Has the database been compacted and repaired recently?
Is the customer running more than one copy of the application at the same time?
Is the database local to the machine with the problem or is it shared on a network drive?
Does it have a password?
What's the command that's failing?
???
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave Kreskowiak:
Thank you for your answer. today i will confirm the MDB file from the customer.
(1)>What's the command that's failing?
the following is the failing SQL:
SELECT ORIGIN_PE_CD,
ORIGIN_PC_CD,
ORIGIN_PC_SH_CD,
ORIGIN_PC_ALSNAME,
ORIGIN_PC_ADDRESS,
ORIGIN_PC_CHFNAME,
BAN34,
BAN35,
DEL_FLG
FROM K_T_PC_INFO
(2)>Does it have a password?
yes. the mdb file has a password. i have seen the log file, connection to that mdb file was successfully built. when excuting any SQL, that error happened.
(3)> Is the database local to the machine with the problem or is it shared on a network drive?
no. the log file tells that MDB file is in the c:\program files\kapp
|
|
|
|
|
Hi
Can anyone tell me if there is a method of loading an ADO persisted recordset XML file (VB6) into a .NET datatable, without installing ADODB in the project?
David Loring
!! Keep Music Live !!
|
|
|
|
|
DA_Loring wrote: without installing ADODB in the project?
Which project? The VB6 one that writes the XML file or the VB.NET one that loads it? Or do I have that backwards?
The only other way would be to load the document into an XmlDocument object and parse it manually.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi Dave
The VB6 project writes the file and the .NET project loads it. I did find .ReadXML but the project is not in a state to run this yet. Would .ReadXML understand the VB6 recordset schema?
The code I was thinking to use is
dTable.ReadXml(shareParams.OperationalShare & "\" & shareParams.GeneralInputFolder & "\" & dtRow("DataFileName"))
Where dTable is a DataTable and the parameter is the file name.
David Loring
!! Keep Music Live !!
|
|
|
|
|
XML is a standardized format, having nothing to do with VB6. ADO will still use the same data types.
And yes, you'd probably use DataSet.ReadXml to load the data.
It's easy enough to test. Should take you about 20 minutes to wipe together two small apps to test the data export to XML and read it again in VB.NET.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks very much for your help Dave.
David Loring
!! Keep Music Live !!
|
|
|
|
|
Is there a way to initialise a control in a control variable from a text string of the controls name i.e.
dim ctl as control
dim sControlName as string = "myTextBox"
...
ctl.name = sControlName
The control could be a picturebox, textbox, or label.
using vb.net 2003.
At the moment I search through controls on the form until I get a match, it's a bit slow.
I'm doing this with a plastic card design/print program. I save the position of each control into a text file then I open it and read the x and y to position each control
Thanks,
Bruce
Don't forget to brush |||_____
|
|
|
|
|
for each ctl as control in me.controls<br />
if ctl.name = sControlName then<br />
'do actions<br />
end if<br />
next
This is probbaly the fastest way to do it.
Posted by The ANZAC
|
|
|
|
|
Thanks, that's what I'm doing. Just thought.....
Bruce
Don't forget to brush |||_____
|
|
|
|
|
If you have the strings and you want to find the controls, you could build a dictionary that maps names to controls.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You've got me there. I haven't a clue how to do a dictionary.
Bruce
Don't forget to brush |||_____
|
|
|
|
|
I have no idea of the VB sytnax, but a dictionary is an associative container, so you'll end up able to do this
Dim c as Control = myDictionary("MycontrolName")
It's something like
Dim dic as Dictionary(String, Control)
It's a generic container.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for that.
The dictionary did sort a few things out and run faster.
It would be better if you didn't have to loop through to find what you need.
Bruce
Don't forget to brush |||_____
|
|
|
|
|
i add control to cells but as default it locate in Top Left and i can't change it's position to center auomaticaly.
-- modified at 16:12 Sunday 15th April, 2007
|
|
|
|
|
I don't think you can have it centered on the TableLayoutPanel.
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[ ^]
|
|
|
|