C# Tutorial - Change ConnectionString at Runtime with App.config | FoxLearn

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 115

  • @sistemasaprovados
    @sistemasaprovados 3 года назад

    Muito Obrigado, você me fez dar um salto alto em meu projeto, nem sei como te agradecer, faltava somente isso para automatizar as configurações de conexão do meu sistema.
    Thank you very much, you made me take a high leap in my project, I don't even know how to thank you, that was all I needed to automate my system's connection settings.

  • @theg4meover988
    @theg4meover988 3 года назад

    If i use entity framework in my c# project , should i go with the same process as the video ?

  • @Microjam
    @Microjam 3 года назад

    Excellent presentation with a solution that works well. Easy to follow. Thank you.

  • @rafaelferreira7408
    @rafaelferreira7408 3 года назад

    Thank you, now I'm gonna try to do this with my WPF app.

  • @deepakbhanushali1
    @deepakbhanushali1 4 года назад +1

    Can you provide same thing for Access Database , I have 2 set of database 1st one is companymaster, 2nd is datamaster where datamaster will select database as per company name and financial year selected from companymaster

  • @lps3026
    @lps3026 7 лет назад

    Hi thanks so much for your video, but I want to ask how should I do if I use LinQ

  • @marcusshamase2050
    @marcusshamase2050 7 лет назад

    Hi thanks for the video. If I may ask is there a way to use two databases in one connectionstring c# winforms? Please help

  • @abdulmalik1389
    @abdulmalik1389 6 лет назад +1

    Excellent man, I love this video....this is something I was looking for...Thanks man

  • @AngelPatxiRodriguezFernandez
    @AngelPatxiRodriguezFernandez 3 года назад +1

    It works correctly in debug but when installing it in Program Files it does not work. It does not change the connection string. There is no permission to edit the file. Any suggestion?

  • @fawazaliaskar
    @fawazaliaskar 3 года назад

    hi what if i use intity frame work what change need in connection string

  • @panda3131
    @panda3131 2 года назад

    how is it implemented in the main form?

  • @ybscambo6975
    @ybscambo6975 2 месяца назад

    I want to know how to config firewall to use public ip connection

  • @dailyquran2072
    @dailyquran2072 3 года назад

    Great Video

  • @CarlosRivera-xu1zf
    @CarlosRivera-xu1zf 2 года назад

    Nice video

  • @JuanRamirez-uq1ct
    @JuanRamirez-uq1ct 4 года назад

    Thanks for share this video. that was really helpful and I really enjoyed your explanation

  • @hasmukhsavaliya4657
    @hasmukhsavaliya4657 5 лет назад +1

    Hello, the XML configuration file (.exe.Config) file under bin > Debug folder is changed with new connection parameter using your solution, but there is no effect of changed connection string the program always using the old connection string when running again, Please help/correct ;)

  • @WillGab
    @WillGab 6 лет назад

    How very clear tutorial, thank you so much.

    • @foxlearn
      @foxlearn  6 лет назад

      Thank you so much !

  • @carlvergara7457
    @carlvergara7457 6 лет назад +1

    Hi it says The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.
    I already check my app.config but stll i get that error,
    Thanks for the response. Please give me response because I badly need it.

  • @SiakNiTonying
    @SiakNiTonying 7 лет назад +1

    helllo foxlearn
    can i request ..how can you retrieve a data in database inserted to combo box or textbox or datagridview using this?
    thanks

  • @islam_TVs
    @islam_TVs 4 года назад

    Can you make a tutorial on
    How to make Setup File of a C# Windows Application with SQL server database. Database created on SSMS and connected through connection string.

    • @foxlearn
      @foxlearn  4 года назад

      ok. Thank you for your suggestion

  • @dailyquran2072
    @dailyquran2072 3 года назад

    I Want to know that how to implement this configuration page in our project?
    please...

  • @afzalhossainbd
    @afzalhossainbd 5 лет назад

    Thanks for the nice video. After saving the settings, I have to close and re-open the program otherwise saved settings do not work even I can see .conf already saved with new information! Is there anything that I can do: save and setting applies?

    • @foxlearn
      @foxlearn  5 лет назад

      You should copy your program to another folder. each time you rebuild your project all data in the debug folder will be deleted.

  • @SystemServer
    @SystemServer 5 лет назад +1

    Thanks.
    How to worked with XAF as same as it;
    Lesson Please....

    • @foxlearn
      @foxlearn  5 лет назад +1

      OK. Thank you for your suggestion !

  • @rockyivic
    @rockyivic 3 года назад

    Great video!!! Thanks!

  • @noobz186
    @noobz186 4 года назад

    Can you show this in web application? Much appreciated!

    • @foxlearn
      @foxlearn  4 года назад

      OK. Thank you for your suggestion.

  • @jaime2911
    @jaime2911 6 лет назад +3

    You forgot to add in the video the reference to the System.Configuration class

  • @nboooly
    @nboooly 4 года назад

    thank you very much, that was very helpfull, ans the explaination is wonderful!

  • @queirozquery5734
    @queirozquery5734 3 года назад

    Need Help, Make a tutorial showing the use of (two connection strings) connection with Local and Remote database in C # language. Thanks!

  • @TanNguyen-wd1sp
    @TanNguyen-wd1sp 4 года назад

    Thank so much

    • @foxlearn
      @foxlearn  4 года назад

      You're welcome. Thank you !

  • @johnchen0213
    @johnchen0213 6 лет назад

    are you a robot? who made this music? I'm impressed....

  • @matigarimanjirungi59
    @matigarimanjirungi59 6 лет назад

    Hello Foxlearn Facing an error @config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
    Error number CS0029 : Cannot implicitly convert type 'system.configuration.configuration' to "***** .configuration
    please help

  • @bongemhoangtu2468
    @bongemhoangtu2468 6 лет назад

    Hello Fox, I have the error here how I can fix that? : 'The SelectCommand property has not been initialized before calling 'Fill'.'

  • @DaveJamesTech
    @DaveJamesTech 7 лет назад

    how i can used this tutorial with entity framework?
    thanks this is great tutorial

    • @foxlearn
      @foxlearn  7 лет назад

      Hi, You can create a config form and use this code to save your connection string when using entity framework, Thank

    • @DaveJamesTech
      @DaveJamesTech 7 лет назад

      thanks for the tip

    • @DaveJamesTech
      @DaveJamesTech 7 лет назад

      not working on entity framework. please help me

    • @foxlearn
      @foxlearn  7 лет назад +1

      You should use entity framework code first, Thank you

  • @shooterrick1
    @shooterrick1 5 лет назад

    What is the cboServer? I don't understand where that came from.

    • @foxlearn
      @foxlearn  5 лет назад

      cboServer is a name of combobox control

  • @shehrozimran
    @shehrozimran 4 года назад

    HI Fox learn Team,
    string connectionString = string.Format("Data Source={0};Initial Catalog={1};User ID={2};Password={3};", txtcomboBox.Text, Databasetxt.Text, usertxt.Text, passwordtxt.Text);
    in this code my connection STring return null . Can you tell me why?

    • @foxlearn
      @foxlearn  4 года назад

      Please check your code again. I think you miss something

    • @shehrozimran
      @shehrozimran 4 года назад

      @@foxlearn i copied all your code but connectionstring variable receive null as i do debugging

  • @FelixSamora
    @FelixSamora 7 лет назад

    Hola, Saludos ! Donde puedo descargar el proyecto ? , Gracias !

  • @md.rezaulkarim
    @md.rezaulkarim 6 лет назад +2

    Keyword not supported: 'datasource'
    Showing this error msg when I click connect button.

  • @homeyasamal8474
    @homeyasamal8474 5 лет назад

    Fox learn super

    • @foxlearn
      @foxlearn  5 лет назад +1

      Thank you so much !

  • @samael8100
    @samael8100 7 лет назад

    can you create a tutorial for vbdotnet?

  • @RamanjaneyuluKondaru
    @RamanjaneyuluKondaru 3 года назад

    It can't save the config file in the network installation... please help us to save the config file details in network location
    Thanks

    • @foxlearn
      @foxlearn  3 года назад

      I think you should run your app as administrator

  • @gilbertoasuaje6763
    @gilbertoasuaje6763 8 лет назад

    Once it is already packaged with the VisualStudio wrapper, could you use this tool to change the configuration of the connection string? Or is there a way to create a text file and that there is the connection string?
    Thanks for these videos, they helped me a lot. and I apologize for my English

    • @foxlearn
      @foxlearn  7 лет назад +1

      Hi, You can go app.config to change the connection string. Thanks

  • @khanalzai20
    @khanalzai20 7 лет назад +1

    i am getting this 2 errors
    Could not find schema information for the element connectionString
    the type initializer for system.data.sqlconnection threw an exception

    • @foxlearn
      @foxlearn  7 лет назад

      Hi, Please check your connection string again in the app.config file. remember add reference to System.Configuration.dll. Thank you

  • @nouriyacine8823
    @nouriyacine8823 4 года назад

    why u didn't upload the code in the description ?

    • @foxlearn
      @foxlearn  4 года назад

      You can find demo at foxlearn.com . Thank you !

  • @sherwinmanguilin1173
    @sherwinmanguilin1173 8 лет назад

    hi fox learn good day im wondering if how can i use the connection with this tutorial thanks

    • @sherwinmanguilin1173
      @sherwinmanguilin1173 8 лет назад

      i mean on how can i use it in selecting updating and etc

    • @foxlearn
      @foxlearn  8 лет назад

      Hi, You can view more at: ruclips.net/p/PL-EU0JUF-XD2qtVK0pOkCeWLUbnnnMo0k . Thank you !

    • @sherwinmanguilin1173
      @sherwinmanguilin1173 8 лет назад

      +Fox Learn ok thanks!! can i have all your examples insert update delete, user authenticate with sql server including this my email is manguilins@gmail.com thankyou verymuch!!

  • @thong.na2510
    @thong.na2510 7 лет назад

    Thank you!

  • @harysetiawan3005
    @harysetiawan3005 5 лет назад

    Wooww..keren = great !

    • @foxlearn
      @foxlearn  5 лет назад

      Thank you so much !

  • @ngocluunguyenbao4490
    @ngocluunguyenbao4490 6 лет назад +1

    Dear sir/madam! I can't save the changes to app.config! Please help me :(

    • @foxlearn
      @foxlearn  6 лет назад

      Please check your code again. Try to run your app as administrator. Thank you

  • @Rasim_93
    @Rasim_93 6 лет назад

    Thank you :)

  • @SiakNiTonying
    @SiakNiTonying 7 лет назад

    Error 1 'Connection.Sqlhelper.IsConnection.get': not all code paths return a value c:\users\anthony\documents\visual studio 2013\Projects\Connection\Connection\SQLHELPER.cs 22 13 Connection
    what to do?

  • @MrSyed33
    @MrSyed33 7 лет назад

    Hello Fox, The code runs smoothly but my connection string is not updated when i press the save button even though the message box says that it has been successfully saved. pls help

    • @johnreytungul4188
      @johnreytungul4188 7 лет назад

      This will work once you publish/made a .exe of your application.

  • @elifgozdeklc9694
    @elifgozdeklc9694 5 лет назад

    How can the current connection string be called in a different form? How to associate with an SQL query?
    SqlCommand cmd= new SqlCommand("Select HOST from BAGLANTI where ID=@p1", helper ??);

    • @foxlearn
      @foxlearn  5 лет назад

      Change your connectionstring in the app.config file

    • @ArunTr
      @ArunTr 4 года назад

      Elif connection stringi yapamadim bana yardimci olurmusun?

  • @وساماسماعيلعمر
    @وساماسماعيلعمر 6 лет назад +1

    Unfortunately this method doesn't work for me .. Can you send me source code ?

  • @Ranjithkumar-tr1mh
    @Ranjithkumar-tr1mh 7 лет назад

    Hi, I cant access the file. It is saying that access to the path is denied. Any solution for this will be appreciated.

    • @foxlearn
      @foxlearn  7 лет назад

      Hi, You need to select your application run as administrator. Thanks

  • @fademaydarkness1017
    @fademaydarkness1017 4 года назад

    object reference not set to an instance of an object while saving

    • @foxlearn
      @foxlearn  4 года назад

      Please check your connection string name

  • @rahulsharma-tm4ye
    @rahulsharma-tm4ye 6 лет назад

    dear sir/mam i am getting keyword not supported :"datasource' error please help me to solve while connecting with sa password

    • @foxlearn
      @foxlearn  6 лет назад

      Please check your connection string again. You should enter your server name, user name and password of your sql account

    • @adelmerhej4194
      @adelmerhej4194 6 лет назад

      It should be "Data Source" and NOT "DataSource"

  • @Saobranaung
    @Saobranaung 7 лет назад

    Thanks

  • @gilbertoasuaje6763
    @gilbertoasuaje6763 8 лет назад

    Excuse me, i did not realize it. Hi, i hope these

    • @foxlearn
      @foxlearn  7 лет назад

      You're welcome. Thank you so much

  • @j.r.4938
    @j.r.4938 8 лет назад

    Hello, some tutorial for a login with Facebook.

    • @foxlearn
      @foxlearn  8 лет назад +1

      ok. thank you for your suggestion

  • @softer.prakashmishra8040
    @softer.prakashmishra8040 Год назад

    Keyword not supported

  • @michaelmashigwana4669
    @michaelmashigwana4669 3 года назад

    Please help with this :
    Using windows form project write a C# application and make use of CRUD (Create, Read, Update and
    Delete) to include a Search function, Read function, Update function and delete function. Take
    Students as a Data Source (with its properties) and perform LINQ queries on this. All the CRUD
    procedures should be done on the C# IDE and update the information on the SQL Server database as
    well.
    Students are allowed to use different properties and colors, to make the application more real world
    like.

  • @Jesus72188
    @Jesus72188 6 лет назад

    Me gustaría un vídeo con access 2016 y Vb.net 2017

    • @foxlearn
      @foxlearn  6 лет назад

      OK. Thank you for your suggestion. I'll upload all videos using vb.net as soon as possible !

    • @Jesus72188
      @Jesus72188 6 лет назад

      @@foxlearn Thank you

  • @charli384
    @charli384 5 лет назад

    config.ConnectionStrings.ConnectionStrings[key].ConnectionString = 'config.ConnectionStrings.ConnectionStrings[key].ConnectionString'
    error: 'System.NullReferenceException'

    • @foxlearn
      @foxlearn  5 лет назад

      Please check your connection string in the app.config file. thank you !

    • @cut1e_
      @cut1e_ 5 лет назад

      @@foxlearn
      An unhandled exception of type 'System.NullReferenceException'
      Error in this line
      config.ConnectionStrings.ConnectionStrings[key].ConnectionString = value;
      What exactly do I need to fix?
      connectionString="Data Source=DESKTOP-65QMQGS\SQLEXPRESS;Initial Catalog=uchhet_izm;Integrated Security=True?;"
      Please answer me, it is very important for me

    • @cut1e_
      @cut1e_ 5 лет назад

      @@foxlearn I found my mistake, I had a different form name. In general, thank you very much for the video, I suffered for a very long time until I found you)

  • @hadirotafoua5381
    @hadirotafoua5381 4 года назад

    thanks