how to connect access database on web server
-
Hi All, I M trying to connect to access database it is done and working perfectly in my local machine. But when i upload the pages to web server it is retrieving the data from database but does not allow saving the data so could you please tell me how can i solve this problem. Thanks in advance.
-
Hi All, I M trying to connect to access database it is done and working perfectly in my local machine. But when i upload the pages to web server it is retrieving the data from database but does not allow saving the data so could you please tell me how can i solve this problem. Thanks in advance.
Define any web form, then you established connection with any provider after this create command for accessing query and finaly define datareader class. using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=c:/db1.mdb;"); con.Open(); OleDbCommand cmd = new OleDbCommand("select *from login", con); OleDbDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { if (TextBox1.Text == dr.GetString(0)) if (TextBox2.Text == dr.GetString(1)) Response.Redirect("default2.aspx"); else lbl.Text="check the username and password"; CheckBox1.Text = "check the username and password"; } //con.Close(); } protected void LinkButton1_Click(object sender, EventArgs e) { } }
-
Hi All, I M trying to connect to access database it is done and working perfectly in my local machine. But when i upload the pages to web server it is retrieving the data from database but does not allow saving the data so could you please tell me how can i solve this problem. Thanks in advance.
Dhrumil_Shukla wrote:
web server it is retrieving the data from database but does not allow saving the data
Its means your connection string is not valid. Do you have the database on web server or any different system ? What your connectionString contains?
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
Dhrumil_Shukla wrote:
web server it is retrieving the data from database but does not allow saving the data
Its means your connection string is not valid. Do you have the database on web server or any different system ? What your connectionString contains?
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
my datbase is on web server and the connectionstring is like "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|table.mdb;Persist Security Info=True"