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

  Рет қаралды 118,092

Fox Learn

Fox Learn

Күн бұрын

Пікірлер
@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.
@Microjam
@Microjam 3 жыл бұрын
Excellent presentation with a solution that works well. Easy to follow. Thank you.
@abdulmalik1389
@abdulmalik1389 7 жыл бұрын
Excellent man, I love this video....this is something I was looking for...Thanks man
@rafaelferreira7408
@rafaelferreira7408 4 жыл бұрын
Thank you, now I'm gonna try to do this with my WPF app.
@JuanRamirez-uq1ct
@JuanRamirez-uq1ct 4 жыл бұрын
Thanks for share this video. that was really helpful and I really enjoyed your explanation
@WillGab
@WillGab 6 жыл бұрын
How very clear tutorial, thank you so much.
@foxlearn
@foxlearn 6 жыл бұрын
Thank you so much !
@dailyquran2072
@dailyquran2072 3 жыл бұрын
Great Video
@nboooly
@nboooly 4 жыл бұрын
thank you very much, that was very helpfull, ans the explaination is wonderful!
@deepakbhanushali1
@deepakbhanushali1 4 жыл бұрын
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
@hasmukhsavaliya4657
@hasmukhsavaliya4657 5 жыл бұрын
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 ;)
@rockyivic
@rockyivic 3 жыл бұрын
Great video!!! Thanks!
@carlvergara7457
@carlvergara7457 6 жыл бұрын
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 жыл бұрын
helllo foxlearn can i request ..how can you retrieve a data in database inserted to combo box or textbox or datagridview using this? thanks
@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
@CarlosRivera-xu1zf
@CarlosRivera-xu1zf 2 жыл бұрын
Nice video
@jaime2911
@jaime2911 6 жыл бұрын
You forgot to add in the video the reference to the System.Configuration class
@khanalzai20
@khanalzai20 7 жыл бұрын
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
@fawazaliaskar
@fawazaliaskar 3 жыл бұрын
hi what if i use intity frame work what change need in connection string
@AngelPatxiRodriguezFernandez
@AngelPatxiRodriguezFernandez 3 жыл бұрын
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?
@theg4meover988
@theg4meover988 3 жыл бұрын
If i use entity framework in my c# project , should i go with the same process as the video ?
@lps3026
@lps3026 7 жыл бұрын
Hi thanks so much for your video, but I want to ask how should I do if I use LinQ
@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 жыл бұрын
Thanks. How to worked with XAF as same as it; Lesson Please....
@foxlearn
@foxlearn 5 жыл бұрын
OK. Thank you for your suggestion !
@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
@md.rezaulkarim
@md.rezaulkarim 6 жыл бұрын
Keyword not supported: 'datasource' Showing this error msg when I click connect button.
@elhoucineawixor3072
@elhoucineawixor3072 5 жыл бұрын
its " Data Source={0} " not " DataSource={0} "
@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'.'
@ybscambo6975
@ybscambo6975 3 ай бұрын
I want to know how to config firewall to use public ip connection
@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
@johnchen0213
@johnchen0213 6 жыл бұрын
are you a robot? who made this music? I'm impressed....
@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?
@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
@panda3131
@panda3131 2 жыл бұрын
how is it implemented in the main form?
@dailyquran2072
@dailyquran2072 3 жыл бұрын
I Want to know that how to implement this configuration page in our project? please...
@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.
@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: kzbin.info/aero/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!!
@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
@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?
@harysetiawan3005
@harysetiawan3005 5 жыл бұрын
Wooww..keren = great !
@foxlearn
@foxlearn 5 жыл бұрын
Thank you so much !
@TanNguyen-wd1sp
@TanNguyen-wd1sp 4 жыл бұрын
Thank so much
@foxlearn
@foxlearn 4 жыл бұрын
You're welcome. Thank you !
@ngocluunguyenbao4490
@ngocluunguyenbao4490 6 жыл бұрын
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
@noobz186
@noobz186 4 жыл бұрын
Can you show this in web application? Much appreciated!
@foxlearn
@foxlearn 4 жыл бұрын
OK. Thank you for your suggestion.
@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
@homeyasamal8474
@homeyasamal8474 5 жыл бұрын
Fox learn super
@foxlearn
@foxlearn 5 жыл бұрын
Thank you so much !
@FelixSamora
@FelixSamora 7 жыл бұрын
Hola, Saludos ! Donde puedo descargar el proyecto ? , Gracias !
@samael8100
@samael8100 7 жыл бұрын
can you create a tutorial for vbdotnet?
@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 жыл бұрын
You should use entity framework code first, Thank you
@thong.na2510
@thong.na2510 7 жыл бұрын
Thank you!
@queirozquery5734
@queirozquery5734 4 жыл бұрын
Need Help, Make a tutorial showing the use of (two connection strings) connection with Local and Remote database in C # language. Thanks!
@foxlearn
@foxlearn 4 жыл бұрын
Not change
@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"
@Rasim_93
@Rasim_93 6 жыл бұрын
Thank you :)
@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
@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 8 жыл бұрын
Hi, You can go app.config to change the connection string. Thanks
@وساماسماعيلعمر
@وساماسماعيلعمر 6 жыл бұрын
Unfortunately this method doesn't work for me .. Can you send me source code ?
@تكنولوجياومنوعات
@تكنولوجياومنوعات 6 жыл бұрын
Yes it is true
@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 !
@fademaydarkness1017
@fademaydarkness1017 4 жыл бұрын
object reference not set to an instance of an object while saving
@foxlearn
@foxlearn 4 жыл бұрын
Please check your connection string name
@j.r.4938
@j.r.4938 8 жыл бұрын
Hello, some tutorial for a login with Facebook.
@foxlearn
@foxlearn 8 жыл бұрын
ok. thank you for your suggestion
@gilbertoasuaje6763
@gilbertoasuaje6763 8 жыл бұрын
Excuse me, i did not realize it. Hi, i hope these
@foxlearn
@foxlearn 8 жыл бұрын
You're welcome. Thank you so much
@Saobranaung
@Saobranaung 7 жыл бұрын
Thanks
@goodluckcomputershorthandc4305
@goodluckcomputershorthandc4305 6 жыл бұрын
error Keyword not supported: 'datasource' Showing this error msg when I click connect button.
@goodluckcomputershorthandc4305
@goodluckcomputershorthandc4305 6 жыл бұрын
any body can reply
@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
@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.
@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)
@softer.prakashmishra8040
@softer.prakashmishra8040 Жыл бұрын
Keyword not supported
@hadirotafoua5381
@hadirotafoua5381 4 жыл бұрын
thanks
@foxlearn
@foxlearn 4 жыл бұрын
You're welcome!
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
c# tutorial for beginners| connect C# with selected MS access database (accdb and mdb)
25:05
dynamic Config SQL Connection For C# Apps
27:19
C# Code Academy
Рет қаралды 8 М.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
thoughtbot
Рет қаралды 910 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 219 М.
app.config access connection string settings in winforms
8:37
Haritha Computers & Technology
Рет қаралды 10 М.