Question

You need to create your own connection string. So you need to know what each of...

You need to create your own connection string. So you need to know what each of the parts of the connection string mean.

  • The connection string needs to know the location where the SQL Server resides, and that's usually a domain name or IP address. This may vary!
  • Then you need to know who you are talking to, and that is the name of the server. This is the initial catalog.
  • The AttachDbFilename shows the name of the file and the path. Since we want to move the application we use a variable that will represent the path, |DataDirectory|. It actually maps to the App_Data folder.  
  • Give the connection string variable a better descriptive name than connectionString. You can't use variable names twice. Definitely don't call it connection string. Some people call it the name of the database and append SQL.
  • You will use Integrated Security for class. In a production server you may need to pass a username and password.
  1. So your task, is to figure out what your connection string should be and add it to your web.config file.
  2. Take a screen shot of your web.config file.
  3. In your reply to another students post, comment on the syntax of the other students connection string. Is it correct? If not, what should be fixed?

You'll need this connection string for next week's homework assignment. So this will help you to get ready for next week too.

If you need to verify the connection string, you can drag and drop a SQL Data Source control from the toolbox Data tab to the page, and use the Wizard. It will generate the connection string for you and store it in the web.config file. It's not required, but it is one way to verify your connection string on your system is correct.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new Web Application in asp.net with C# is created using Visual Studio 2017 with name "Demo_WebApplication".This application contains a below connection string in web.config file.

<!--connection string-->
<connectionStrings>
<add name="SalesDBConnectionString"
connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=.\Demo_WebApplications\Demo_WebApplications\App_Data\SalesDB.mdf;Integrated Security=True"/>
</connectionStrings>

Explanation :

  • Here name of the connection string is SalesDBConnectionString
  • Data Source is the server name which is (LocalDB)\MSSQLLocalDB
  • AttachDbFilename is the data database file
  • Integrated Security is true means in development environment no need to username and password.

Screen for web.config :

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
You need to create your own connection string. So you need to know what each of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Create a program to verify a user name and password given by a user 2....

    1. Create a program to verify a user name and password given by a user 2. Create a text file named "correctData.txt" (You will NOT upload this file during submission). Place a username on line 1 in the txt file and a password on line 2 in the file. This will be used for testing. 3. Create the following functions and call them starting from main: • void login () - This function is responsible for displaying the prompts asking...

  • Write a Python program to create userids: You work for a small company that keeps the...

    Write a Python program to create userids: You work for a small company that keeps the following information about its clients: • first name • last name • a user code assigned by your company. The information is stored in a file clients.txt with the information for each client on one line (last name first), with commas between the parts. In the clients.txt file is: Jones, Sally,00345 Lin,Nenya,00548 Fule,A,00000 Your job is to create a program assign usernames for a...

  • Implement the File Input/Output example presented in page 7. You need to create your own test.txt...

    Implement the File Input/Output example presented in page 7. You need to create your own test.txt file using any text editor. The input file should have some integer values (e.g., 10 values) separated by whitespaces. Normally this input file should be placed in the same directory as the program code resides. But depending on the IDE you use, it may be a different directory in the project. Figure out which directory your IDE reads an input file from and writes...

  • You will create your own silly story based on information provided by the user. For example,...

    You will create your own silly story based on information provided by the user. For example, the parts in bold were entered by the user. For ideas see: Mad Libs. My Silly Story name: Frank Zhang whole number: 345 body part: stomach noun: cup floating point number: 1.23 clothing article: hat destination: Colorado goal: degree The resulting story is: Congratulations! Today is your 345 day. You're off to Colorado! You're off and away! You have brains in your stomach, You...

  • Java: student directory GUI You need to implement three classes: Person Student StudentDirectory StudentMain Start by...

    Java: student directory GUI You need to implement three classes: Person Student StudentDirectory StudentMain Start by implementing Person and Student classes. Once you are sure you can serialize and deserialize and ArrayList of Students to and from a file, move on to building the GUI application. Person: The Person class should implement serializable interface. It contains the following: Person's first name (String) Person's last name (String) Person's id number Person's date of birth (Date) public String toString(): This method method...

  • I NEED THE ANSWER IN C++ FORMAT I need the answer In C++ format Your question...

    I NEED THE ANSWER IN C++ FORMAT I need the answer In C++ format Your question has been answered Let us know if you got a helpful answer. Rate this answer Question: Suppose a string variable fullName contains last name of a Suppose a string variable fullName contains last name of a person, followed by a comma, space, and first name Write to the screen a line containing a greeting "Hello <firstName>!", where sfirstName> is the first name taken from...

  • Project Description In this project, you will be developing a multithreaded Web server and a simple...

    Project Description In this project, you will be developing a multithreaded Web server and a simple web client. The Web server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer Protocol). Requirements for the Web server The server is able to handle multiple requests concurrently. This means the implementation is multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an HTTP request, the server sets up a TCP connection to...

  • You shall write a very basic web server in Javascript that will run via nodejs. Your...

    You shall write a very basic web server in Javascript that will run via nodejs. Your project shall include the following line: var paul   = require('/homes/paul/HTML/CS316/p3_req.js'); Your project will accept HTTP requests via URLs in the following format:       /[a-zA-Z0-9_]*.cgi Here are the steps you must perform for .cgi URLs: 1) call http .createserver(myprocess) my process() is a function you will write to process requests from the user via their browser 2) create a mylisten() function that takes the following parameters:...

  • Question 2 (20 marks) – Improving network design Jim is impressed by your report and asks you to write a proposal to improve the network, although his budget is limited he tells you that if you can j...

    Question 2 (20 marks) – Improving network design Jim is impressed by your report and asks you to write a proposal to improve the network, although his budget is limited he tells you that if you can justify your design choices you may be able to purchase some more equipment. You will need to provide a new network design diagram in PowerPoint format, thankfully Jim has included a couple of slides with various network equipment elements that you can use...

  • Here is the description of the client and server programs that you need to develop in C using TCP: Suppose we have a simple student query system, where the server keeps student's info in an array...

    Here is the description of the client and server programs that you need to develop in C using TCP: Suppose we have a simple student query system, where the server keeps student's info in an array of struct student_info ( char abc123171 char name [101 double GPA; To simplify the tasks, the server should create a static array of 10 students with random abc123, name, and GPA in the server program. Then the server waits for clients. When a client...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT