Click here to Skip to main content
15,907,183 members
Home / Discussions / C#
   

C#

 
AnswerRe: handling ctrl+mouse click on webbrowser control in winform Pin
VJ Reddy22-Apr-12 20:06
VJ Reddy22-Apr-12 20:06 
GeneralRe: handling ctrl+mouse click on webbrowser control in winform Pin
hoangminhtoan22-Apr-12 22:11
hoangminhtoan22-Apr-12 22:11 
GeneralRe: handling ctrl+mouse click on webbrowser control in winform Pin
VJ Reddy22-Apr-12 22:58
VJ Reddy22-Apr-12 22:58 
GeneralRe: handling ctrl+mouse click on webbrowser control in winform Pin
hoangminhtoan22-Apr-12 23:12
hoangminhtoan22-Apr-12 23:12 
QuestionAny free GS-1 Databar classes? Pin
nickslick22-Apr-12 10:17
nickslick22-Apr-12 10:17 
AnswerRe: Any free GS-1 Databar classes? Pin
DaveyM6922-Apr-12 11:49
professionalDaveyM6922-Apr-12 11:49 
GeneralRe: Any free GS-1 Databar classes? Pin
nickslick22-Apr-12 12:02
nickslick22-Apr-12 12:02 
Questionabout a code Pin
Gayani Udawatta22-Apr-12 4:26
Gayani Udawatta22-Apr-12 4:26 
AnswerRe: about a code Pin
Richard MacCutchan22-Apr-12 4:33
mveRichard MacCutchan22-Apr-12 4:33 
GeneralRe: about a code Pin
PIEBALDconsult22-Apr-12 6:46
mvePIEBALDconsult22-Apr-12 6:46 
GeneralRe: about a code Pin
Richard MacCutchan22-Apr-12 21:01
mveRichard MacCutchan22-Apr-12 21:01 
AnswerRe: about a code Pin
PIEBALDconsult23-Apr-12 3:14
mvePIEBALDconsult23-Apr-12 3:14 
GeneralRe: about a code Pin
Lutosław23-Apr-12 11:04
Lutosław23-Apr-12 11:04 
Questionconnect to access database Pin
MemberDotNetting22-Apr-12 3:39
MemberDotNetting22-Apr-12 3:39 
AnswerRe: connect to access database Pin
Wes Aday22-Apr-12 3:46
professionalWes Aday22-Apr-12 3:46 
GeneralRe: connect to access database Pin
MemberDotNetting22-Apr-12 3:48
MemberDotNetting22-Apr-12 3:48 
AnswerRe: connect to access database Pin
OriginalGriff22-Apr-12 3:54
mveOriginalGriff22-Apr-12 3:54 
GeneralRe: connect to access database Pin
Wes Aday22-Apr-12 5:47
professionalWes Aday22-Apr-12 5:47 
AnswerRe: connect to access database Pin
Richard MacCutchan22-Apr-12 4:00
mveRichard MacCutchan22-Apr-12 4:00 
GeneralRe: connect to access database Pin
MemberDotNetting22-Apr-12 4:14
MemberDotNetting22-Apr-12 4:14 
GeneralRe: connect to access database Pin
Dave Kreskowiak22-Apr-12 5:45
mveDave Kreskowiak22-Apr-12 5:45 
GeneralRe: connect to access database Pin
Enhakiel26-Apr-12 9:17
Enhakiel26-Apr-12 9:17 
QuestionQuestions about saving objects and databases Pin
larsp77722-Apr-12 0:13
larsp77722-Apr-12 0:13 
AnswerRe: Questions about saving objects and databases Pin
Keith Barrow22-Apr-12 0:49
professionalKeith Barrow22-Apr-12 0:49 
larsp777 wrote:
In the old program we saved to disc in a binary-file.
 
How would you
do it in C#?

The direct "translation" is .net serialization[^]. You don't need to use the binary formatter described, there is an XML one too (and a SOAP one, but the isn't useful in this context) or you could write your own. Note that it (the binary one) almost certainly won't deserialize the Java files properly.

Personally, I wouldn't store anything "complicted" (say with relations or mutliple rows) this way unless I had really good reasons to. You mention LINQ, "LINQ to SQL" and "Entity Framework" are good ways of persisting data and are similar to eachother. You should Google these. A third (non-Microsofty) option is NHibernate, it has similarities to the Entity Framework, but comes with the added advantage, from your point of view, that there is a Java Equivalent ("Hibernate") so by learning one, you learn the Java version (mod any documented differences).


larsp777 wrote:
I final question is if It is a good design or if it would have been better to
man a traditional relationship database with no objects.

If I understand you correctly, I'd always go for proper relational design, but that doesn't mean you lose good OO at all. The Entity Framework pretty much expects proper relational design (if you design the DB first, it creates well normalised Schema from an OO model if you start with the model first). NHibernate works better under a properly normalised DB too, but is more forgiving of mismatches between the OO and the DB. That said the same things that drive good OO desgin tend to drive DB schemas: A type is pretty much a table, a property to a simple type pretty much a field and a property to a custom class a relationship to another table. Many-to-One maps to a list property at one end and a single property at the other, Many-to-many has maps to lists at both ends.

My advice is to try Entity Framework, starting with the model. Some people have reported performance problems on large data sets, but you can pre-compile LINQ queries and even go the whole hog and use Stored Procs so the perforance is comparable with a little work and you gain more than you lose IMO.


modified 22-Apr-12 6:59am.

GeneralRe: Questions about saving objects and databases Pin
larsp77722-Apr-12 1:50
larsp77722-Apr-12 1:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.