none
Entity Data Model RRS feed

  • Question

  • Hi

    I'm using entity data model wizard to create all my models but I would like not to include sensitive data like password in the connection string.How can I add pasword later  in my application code ?

    I would like to also do the same tthings when i'm using Data source configuration wizard to create Datasets.

    Which is better to connect MYSql db

    - using data source (dataset and fill adapters etc..) or

    - use entity modeland manipulate data using LINQ

    I will appreciate any help. Thank you.

    • Moved by CoolDadTx Thursday, August 10, 2017 6:23 PM EF related
    Monday, July 17, 2017 9:34 PM

Answers

  • https://stackoverflow.com/questions/15209754/set-entity-framework-connection-string-at-runtime

    It should help you or at least get you in the ballpark.

    • Marked as answer by lukes678 Saturday, August 12, 2017 11:36 AM
    Friday, August 11, 2017 1:36 AM

All replies

  • Hi lukes678,

    Thank you for posting here.

    >>How can I add pasword later  in my application code ?

    You could use hash encryption to excrypt your password and put it in database. When you use your password it will be encrypt and compare with the hash value in database to confirm whether the password is right or not.

    >>Which is better to connect MYSql db 

    It is okay. Choose the one you like. I use the most is the first one.

    Here are some examples for your reference.

    https://www.codeproject.com/Articles/43438/Connect-C-to-MySQL

    https://www.codeproject.com/Tips/423233/How-to-Connect-to-MySQL-Using-Csharp

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 4, 2017 2:38 AM
  • Hi

    Thank you for reply, but i'm stilll confuse how can i add password for my entity model in the code e.g model1.Context.cs file.

    Thank you for you rhelp

    Thursday, August 10, 2017 10:45 AM
  • - using data source (dataset and fill adapters etc..) or

    - use entity modeland manipulate data using LINQ

    https://dzone.com/articles/reasons-move-datatables

    http://lauteikkehn.blogspot.com/2012/03/datatable-vs-list.html

    On one hand, you talk about using current technology. And then on the other hand, you want fall back to datasets, wizards, etc., ect, yesteryear outdated technology.

    Thursday, August 10, 2017 11:15 AM
  • Hi

    You have answered to one of my question that I should use entity framework.I wasn't sure which one is better but I was study LINQ and I can see already that entity will be better choose.

    I need to only find out how to and where to save password for my entity model in the code e.g model1.Context.cs file.

    Can you provide some sample od savind connection password stored in code.

    Thank you.

    Thursday, August 10, 2017 6:30 PM
  • https://stackoverflow.com/questions/15209754/set-entity-framework-connection-string-at-runtime

    It should help you or at least get you in the ballpark.

    • Marked as answer by lukes678 Saturday, August 12, 2017 11:36 AM
    Friday, August 11, 2017 1:36 AM
  • Thank you.
    Saturday, August 12, 2017 11:36 AM