"data Source=?" to connect MS Access database at web server
-
static string conn="provider=microsoft.jet.oledb.4.0;data Source="+ Server.MapPath("/data/db1.mdb"); OleDbConnection cn=new OleDbConnection(conn); please help me, where did i make wrong in the above instructions and please solve this. it show error that:'System.Web.UI.Page.Server' denotes a 'property' where a 'class' was expected www.mywebsite.com/data/db1.mdb how to access the db1.mdb file using Asp.NET using c# please help me i will be thank full to you. please answer me with above example multimedia9
-
static string conn="provider=microsoft.jet.oledb.4.0;data Source="+ Server.MapPath("/data/db1.mdb"); OleDbConnection cn=new OleDbConnection(conn); please help me, where did i make wrong in the above instructions and please solve this. it show error that:'System.Web.UI.Page.Server' denotes a 'property' where a 'class' was expected www.mywebsite.com/data/db1.mdb how to access the db1.mdb file using Asp.NET using c# please help me i will be thank full to you. please answer me with above example multimedia9
Hi Check this link Connection Strings[^]
Harini
-
Hi Check this link Connection Strings[^]
Harini
Hi frnd Thank u They hav given the general connection strings, these are used to connect to local host, but i need to connect to webserver. if you reply with appr answer i will be very happy, & please try to know the answer by asking ur colleagues. i will be thank ful to you if you consider this request. multimedia9
-
Hi frnd Thank u They hav given the general connection strings, these are used to connect to local host, but i need to connect to webserver. if you reply with appr answer i will be very happy, & please try to know the answer by asking ur colleagues. i will be thank ful to you if you consider this request. multimedia9
Hi 1. After deploying your web application in server and link will be like:
http://10.57.89.15/TestWebApplication/page.aspx
2. The Virtual directory (i.e 'TestWebApplication' as in the above code) you created in server can be modified using Web.Config. Add a key and value to store virtual directory name. Use this key in your code-behind file.ConfigurationSettings.AppSettings
3. If your .mdb file is in sub-folder of your web app i.e., in App_Data. Then that file can be accessed using the foll. codestring StrDataSource = Server.MapPath("\\TestWebApplication\\App_Data\\db1.mdb");
Hope you got it.Harini
-
Hi 1. After deploying your web application in server and link will be like:
http://10.57.89.15/TestWebApplication/page.aspx
2. The Virtual directory (i.e 'TestWebApplication' as in the above code) you created in server can be modified using Web.Config. Add a key and value to store virtual directory name. Use this key in your code-behind file.ConfigurationSettings.AppSettings
3. If your .mdb file is in sub-folder of your web app i.e., in App_Data. Then that file can be accessed using the foll. codestring StrDataSource = Server.MapPath("\\TestWebApplication\\App_Data\\db1.mdb");
Hope you got it.Harini
hi thank u :) string StrDataSource = Server.MapPath("\\TestWebApplication\\App_Data\\db1.mdb"); this instruction gives an error that " 'System.Web.UI.Page.Server' denotes a 'property' where a 'class' was expected ". Please solve this problem. thank u
-
hi thank u :) string StrDataSource = Server.MapPath("\\TestWebApplication\\App_Data\\db1.mdb"); this instruction gives an error that " 'System.Web.UI.Page.Server' denotes a 'property' where a 'class' was expected ". Please solve this problem. thank u
Hi It was working fine for me when I give Server.MapPath. Try change Server.MapPath to HttpContext.Current.Server.MapPath
Harini
-
Hi It was working fine for me when I give Server.MapPath. Try change Server.MapPath to HttpContext.Current.Server.MapPath
Harini
ya its working thank u very very much for avoiding such error, by using HTTP.........:) could u plz help me in another prob My website contains 1)let me take my website ftp address 10.29.398.456 & http address www.mydomain.com 2)under which /db /logs /wwwroot folders are there 3)under /wwwroot /data /mail and some other folders 4)under /data /db1.mdb is there by using above example please write configurationSettings & connection string bcoz even though it not showing error it shows error at runtime thank u very much, I hope u will reply for this. multimedia9