Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 04 Nov 2016 12:36 #569

  • Phil Hepburn
  • Phil Hepburn's Avatar
  • Topic Author


  • Posts: 743
  • Hi Robert, Team and guys,

    I am now trying to get my database connections and table mappings right in X# syntax. I have had some success but am finding a few other problems. I am trying 'LINQ to SQL' before I move over to 'LINQ to Entity'.

    All the code I am copying/using has worked in C#.

    So far I can detect in code the possible SQL Servers, and I can create a connection string and open a database file.

    My current issue is trying to define a 'DataContext' class in which I map my Tables.

    Can you first of all tell me how I should place / attach the 'Attributes' in X#.

    I attach samples of my previous code and also what I am trying at the moment.

    HELP !!!! please .............>>

    Cheers,
    Phil.

    Please Log in or Create an account to join the conversation.

    Last edit: by robert.

    Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 04 Nov 2016 12:38 #570

    • Phil Hepburn
    • Phil Hepburn's Avatar
    • Topic Author


  • Posts: 743
  • Should have come previously - one of those Fridays !!! ;-0((

    Please Log in or Create an account to join the conversation.

    Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 04 Nov 2016 14:45 #571

    • Phil Hepburn
    • Phil Hepburn's Avatar
    • Topic Author


  • Posts: 743
  • Hi Robert and the gang,

    I have cracked my little problem I think.

    I needed to include 'using System.Data.Linq.Mapping' at the head of my code section.

    Remember that the Visual Studio facilities are quite reduced to what I am used to with C#. So its a bit of a fumble around - BUT - I am getting there.

    Fingers crossed,
    Cheers,
    Phil.

    Please Log in or Create an account to join the conversation.

    Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 04 Nov 2016 14:56 #572

    • Phil Hepburn
    • Phil Hepburn's Avatar
    • Topic Author


  • Posts: 743
  • Yes, guys,

    Further testing shows the attached simple LINQ query to work - this is 'LINQ to SQL' as the collection is being generated after a query is sent by the 'system' at runtime to my SQL database engine - using the MDF data file specified in the connection string.

    I should be away now, foot in the door and all those sorts of comments.

    Thanks for listening,
    Phil.

    Please Log in or Create an account to join the conversation.

    Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 04 Nov 2016 15:14 #573

    • lumberjack
    • lumberjack's Avatar


  • Posts: 721
  • Phil,

    Just a question, why don't you use the Pearl NG that was setup for this purpose? Now have to go to the webbrowser to see you attachments.

    LJ
    ______________________
    Johan Nel
    Boshof, South Africa

    Please Log in or Create an account to join the conversation.

    Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 04 Nov 2016 15:51 #574

    • Phil Hepburn
    • Phil Hepburn's Avatar
    • Topic Author


  • Posts: 743
  • Hi LJ - sorry, but I thought my question was a general one about Language.

    Have you read the published 'penalties' for posting in the wrong forum ?

    If Robert, you, and others wish me to put most (all?) of my stuff in Pearls then I will do so.

    It has also taken me a little while to get used to the structure and feel of this new XSharp group, remember, I have been off-line for almost seven months ;-0)

    In the past we used to put stuff in Pearls which was new and interesting (and working), rather than ask questions when standard code stuff which didn't work etc..

    I will listen to advice on this one.

    Best Regards,
    Phil.

    P.S. I will make a positive posting in Pearls on how to get LINQ to SQL fully up and running - for a simple, but meaningful, example.

    Please Log in or Create an account to join the conversation.

    Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 04 Nov 2016 17:52 #575

    • FFF
    • FFF's Avatar


  • Posts: 1419
  • Phil et all,
    i for one vote for use of NG - to look here for something new costs more time than to check > 10 complete newsgroups... And as Wolfgang was so nice to host the NGs, we should use them ;)

    Someone wanted to write a sync tool to make NG and web-fora content "identical", but this probably was swallowed by more pressing work to be done. Perhaps, if you grow tired of ground-sensors (or woodworking <g>) you might volunteer ;-?
    Regards
    Karl (X# 2.15.0.3; Xide 2.15; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 06 Nov 2016 09:12 #576

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3366
  • Hi Karl,

    for ease of use you are right: NG is a better tool. But if I look at Phil's messages: I think they are better in the forum. First, because formatting is better than with every newsreader, second, because they are indexable by Google, and third, they let understand every visitor of xsharp.eu that the project is living.

    Wolfgang

    P.S. yes, the sync tool is in the works, and if someone has more time, I can share my current code and test environment. Until the messages are plain text messages, there is no problem, but it becomes a difficult job if the messages are formatted and with inline images or attachments.
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1