answersLogoWhite

0

How do I create a database login screen on c sharp?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

Basically in order to login to a database you need a couple of inputs from user: -

Server Name

DB Name

UserName/password

All of these would be used to frame a connection string that can be used to initialise a SQLConnection object and open the DB connection.

A standard connection string would be: -

string strSQLconnection = "Data Source=dbServer;Initial Catalog=DBNAME;Integrated Security=True;uname=username;password=pwd";

-> In this case

string strSQLconnection = "Data Source=" + textbox1.text + ";Initial Catalog=" + textbox2.text + "...........

//initialize sqlconnection from the connection string.

SqlConnection sqlConnection = new SqlConnection(strSQLconnection);

//initialize the query to be fired.

SqlCommand sqlCommand = new SqlCommand("select * from table1", sqlConnection);

//open sql connection

sqlConnection.Open();

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do I create a database login screen on c sharp?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which DS screen accessories can protect the screen from smudges but still keep the screen sharp?

Do you remember the first time you bought a DS or a new phone. They usually come with a plastic film over the screen that protects it. Well this would keep smudges off your screen and the screen would still be just as sharp as if it was off.


How do you make a homemade screen protector?

Get ready : a sharp knife, a piece of screen protector film, a ruler, a cell phone apply a piece of screen protector film on the screen ,the film should be bigger than the screen, then cut along the screen edges with a sharp knife. If your garden is bigger enough, you can also buy a screen protector machine.


What are some really cool screen names?

sharp shooter


What is data set in c sharp?

An in-memory database. The database contains tables and constraints, and data.


What is a capillary stencil?

A capillary stencil is a type of stencil used for screen printing. It consists of a thin mesh screen with small openings that allow ink to pass through onto a substrate. The capillary action of the stencil helps to control the flow of ink and create sharp, detailed designs.


What are the dimensions for a Sharp LCD Screen Replacement Backlight for Sony PSP 2000?

The dimensions for a Sharp LCD Screen Replacement Backlight for Sony PSP 2000 are 4.13 in x 4.06 in x 0.16 in.


Why can you only see what is on your ipod nano screen when you look at it on a sharp angle?

You can only see it at sharp angle because the light hits you eyes differently when you don't have it at a sharp angle.


Can i get Angry Birds on my sharp FX?

no s*** shirlock its a touch screen isnt it


Is Sharp a manufacturer of televisions?

Yes, Sharp does manufacture television sets. Sharp products LCD, LED, and plasma screen televisions that range in size from thirteen inches to over seventy inches.


Where can i buy a flat screen sharp?

You can buy a flat-screen Sharp television from any electronics store near you that carries flat-screen televisions. Alternatively, you could purchase the television from an online retailer, such as Amazon.com, but you may be able to save on shipping costs if you haul it home yourself from a local store.


What programming languages may be used to write applications for an Access Database?

The default language for Access applications is VBA (Visual Basic for Applications). With most of the languages C, C Sharp, and the proper references attached one can create application that talk to the Access engine. Proud to be of service HoloGuides.com


When was the first flat screen tv released?

Sharp introduced the first commercial LCD television in 1988.