TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
apoorv srivastava
NA
2
435
Retriev a row from excel and extract data in strings
Apr 18 2018 1:37 AM
i am tring to use excel sheet for a small login form however i am unable to extract data from reader object.
This the table
User_Id
Login_Email
Login_Password
Last_Login
Access_type
xyzabc
[email protected]
Password
c
CODE
string ConStr = "";
string path = Server.MapPath("Login.xlsx");
ConStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=\"Excel 12.0;ReadOnly=False;HDR=Yes;\"";
string query = "Select from [Sheet1$] where [Login_Email] ='"+TextBox1.Text+"'";
OleDbConnection conn = new OleDbConnection(ConStr);
conn.Open();
OleDbCommand cmd = new OleDbCommand(query, conn);
OleDbDataReader reader = cmd.ExecuteReader();
String UEmail = reader["Login_Email"].ToString();
String Pwd = reader["Login_Password"].ToString();
conn.Close();
Reply
Answers (
2
)
WEBAPI, MVC, DAL, BLL in separate projects of same solution
About User Roles