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

TOPIC: Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >>

Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 2 years 8 months ago #569

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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. .... >> 2 years 8 months ago #570

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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. .... >> 2 years 8 months ago #571

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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.
Attachments:

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

Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 2 years 8 months ago #572

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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.
Attachments:

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

Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 2 years 8 months ago #573

  lumberjack's Avatar lumberjack Offline Posts: 494
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
George, South Africa

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

Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 2 years 8 months ago #574

  Phil Hepburn's Avatar Topic Author Phil Hepburn Offline Posts: 742
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. .... >> 2 years 8 months ago #575

  FFF's Avatar FFF Offline Posts: 617
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 ;-?

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

Setting Attributes - X# syntax - for 'LINQ to SQL' etc. .... >> 2 years 8 months ago #576

  wriedmann's Avatar wriedmann Offline Posts: 1631
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.info 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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

  • Page:
  • 1