1

I have a simple html 5 login page, I need to open a sql connection and have a condition to match the entered details and match or not.

code i have right now is this

Email Address: <input id="Text1" type="text" />

Password: <input id="Password1" type="password" />

<input id="Submit1" type="submit" value="Submit"  onclick="loginFunction()"/> 

<input id="Reset1" type="reset" value="Cancel" />

I have created onclick function. Please help me to open a sql connection and verify the login details

3
  • 2
    You need server-side scripting for that. Commented May 27, 2015 at 11:02
  • you have to call sql query from any server side code then call that method from jQuery then you can bring the data in jQuery object Commented May 27, 2015 at 11:04
  • possible duplicate of How to connect to SQL Server database from JavaScript? Commented May 27, 2015 at 11:05

2 Answers 2

2

You need a server side to retrieve data.

You have a bunch of databases that you can use.

Going for a mysql database would be a nice approach as it is 100% open source, very simple and it offers stability, if you choose it advice you to choose php for server side, it is old and not very power full but is good for simple pages and for beginners.

If you prefer a NoSQL database you can chose mongoDb for example and (although i have no experience with this) I think that you can link to the database with json

Sign up to request clarification or add additional context in comments.

Comments

-1

If you are using sql server ms as databse and c# as the server side coding,which i assume you must be using . In the Page Load Or On the Button Click Event Establish a connection string as below.

string connectionString="Data Source=servername;InitialCatalog=DataBaseName;UserID=sa;  Password=YourPassword;"

Now create an Sql Connection object and open the connection

SqlConnection sqlConnection=new SqlConnection(connectionString);
 sqlConnection.open();

Now the database connection is set.If you want to fire any queries now use Sql Command Class.The Parameters of the sqlcommand object are the querystring and connection object.

string insertStatement="INSERT INTO TableName(column1,column2) VALUES Txtb1+","+Txtb2";

SqlCommand sqlCommand=new SqlCommand(insertStatement,sqlConnection);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.