Interview Question in SQL Server Management Studio


 

Interview Question :: How do you connect an ASP.NET file to a database using the VS.net IDE


Whenever I try to connect my web form to SQL server database using the data linking properties of Visual Studio .Net, I always encounter the error that the SQL Server does not exist or access denied.
Answers to "How do you connect an ASP.NET file to a database using the VS.net IDE"
RE: How do you connect an ASP.NET file to a database using the VS.net IDE?

Make sure you have the SQL Server service started up on your machine hosting the database and that access rights have been given to the user accout (accessing the SQL server) under which you are running your .NET webpages.
 
Vote for this answer ::  
RE: How do you connect an ASP.NET file to a database using the VS.net IDE?

why dont you try to connect page to data by code



namespace

-----------

using System.Data.SqlClient;



variable declaration

---------------------

private SqlConnection con = new SqlConnection();







Setting Connectionsring

------------------------

con.ConnectionString ="server=local;userid=sa;password=pwd;da...

if (con.State == ConnectionState.Open) { con.Close(); }

con.Open();



Now you can use SQLDataAdaptor or SqlCommand to do database operations
 
Vote for this answer ::  
Update Alert Setting