Home > Net >  Rookie question: C#.NET development, database connection field is what mean
Rookie question: C#.NET development, database connection field is what mean

Time:10-07

DBConfig. DbConnection=@ "Data Source=localhost \ LOCALDB; Initial Catalog=MemDB; User ID=DBUser; Password=Memadin2019 ";
Is the role of this code, please create the database and set the ID and password? If I want to turn this into an open Source project in the future, the Data Source or localhost \ LOCALDB?
The trouble great god explain it in detail, thank you.

CodePudding user response:

The role of this code is to find the address of the database, and then enter account password, whether or not you want to be open source project has nothing to do with this

CodePudding user response:

Generally in the connection string to the configuration file, so that the user to change

CodePudding user response:

Data Source is the server path
Initial Catalog is a database
User ID=DBUser; Password=Memadin2019
This is the user name password

This does not create the database function
CREATE a database using the CREATE TABLE

CodePudding user response:

Which is Data Source database address, IP, local general use localhost \ LOCALDB, also can use 127.0.0.1, or computer IP

CodePudding user response:

Database connection string, it is a database connection string,
Novice, learn, ado.net,

CodePudding user response:

1, in fact most, don't write, so generally write like this:

DBConfig. DbConnection="Server=127.0.0.1; Uid=sa; The PWD=sa; The Database=mydataBase1 "; So just write the

2, database operations, try not to write their own, have a ready-made auxiliary class, very perfect DbHelperSQL, for example, the people common categories:

CodePudding user response:

Data Source=localhost \ LOCALDB; Initial Catalog=MemDB; User ID=DBUser; Password=Memadin2019

This is the database connection string, is a must, his writing has a lot of kinds such as

Localhost \ LOCALDB==127.0.0.1 \ LOCALDB

CodePudding user response:

Database is a multi-user system, then must need to have a login, you consider is password leaked, then use random password bai, along with a variety of access restrictions, waiting for you to do the real project will see

CodePudding user response:

Just began to learn, is scheduled to open source, goals can be.

CodePudding user response:

The meaning of this code is needed to connect to the database, and connect to the database configuration parameters

CodePudding user response:

You can have a look at Ado.net for the
You name is in SQLhelp cs, connect to the database name server IP is connect to the database, how to configure the local words can baidu, the database is the database name, the rest is the account password,
  •  Tags:  
  • C#
  • Related