How can I convert the query from SQL to LINQ?

SQL Help Writing an Update Query?

  • I've got a table named Customers in Database Access. I want to Update one of my fields (Username) to show the first initial of the first name + last name + customer id. I was told something about using a function called CSTR to convert a number to a string, but I don't understand how I'm supposed to fit it in. Can someone help me?

  • Answer:

    WRONG! NEVER mix these in one field. It totally destroys the effectiveness of the database. The rule wit any database is ever single person must have a unique id, This should be an autonumber primary key. Name should be held in different fields for first names and last name. Ideally you should also include something else with the name as a unique key as well, otherwise you will have confusion when you get multiple John Smith entries. Far better to use maybe their email address as the unique key, this can NOT be duplicated. In any case if you break the fields apart it allows for corrections to spelling without breaking the consistency of the data (making the names the key field will lead to data corruption if this needed to be done) and for changes of name, as when someone gets married. You then use your forms and reports to display the information in any way you like without breaking the system.

Cincinnati Cypher at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

WRONG! NEVER mix these in one field. It totally destroys the effectiveness of the database. The rule wit any database is ever single person must have a unique id, This should be an autonumber primary key. Name should be held in different fields for first names and last name. Ideally you should also include something else with the name as a unique key as well, otherwise you will have confusion when you get multiple John Smith entries. Far better to use maybe their email address as the unique key, this can NOT be duplicated. In any case if you break the fields apart it allows for corrections to spelling without breaking the consistency of the data (making the names the key field will lead to data corruption if this needed to be done) and for changes of name, as when someone gets married. You then use your forms and reports to display the information in any way you like without breaking the system.

Colinc

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.