Wait it looks same but its diff read the problem:- how to connect the ASP.NET with sql server 2005 express edition . [modified]
-
hi All, I just wanted to know the following things if u can just help me. I made a website in Visual Studio 2008 and used the database provided by the VS [I dont know which version is this]. That website runs successfully on the machine having visual studio[As in that i just attach my database through the GUI provided by VS]. Now I want to deploy that website on a LAN. I have the database in .ldf and .mdf format. But I dont know whether it is in sql 2005 or sql 2008[as i made it through Visual Studio GUI] Now the system in which i have to deploy cannot have a licensed product. So i have to convert that database either to open source or an free version of sql server. I chose to go for SQL Server express edition that is free. Now the prolem being whether I use SQL Server 2008 or 2005 as i dont know which database was provided by the VS.[when i made that databse] But the problem being that on the system in which i have to deploy does not contain VS. Supposing it provides SQL Server 2005 express edition I permormed the following test:- Now i have installed .NET framework 3.5, MS SQL server 2005 Express Edition and the SQL Server management studio that is a GUI for handling d/b. Now when I attached that database[that i have, of which i dont have the version]. I can see the database and tbles and all the contents that was there in the d/b.[through that management studio GUI]. Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:- 1> The database that i have is in SQL server 2008 express edition or something else. 2> I have to make some changes in the connectivity[in web.config or some other location] NOTE: Also when i connected the d/b in management stuio it shows all the tables with dbo as a prefix. for eg. suppose i had a table as User_Master than its showing as dbo.User_Master. please guide me if u can. Waiting for ur reply.
modified on Wednesday, October 6, 2010 3:23 AM
-
hi All, I just wanted to know the following things if u can just help me. I made a website in Visual Studio 2008 and used the database provided by the VS [I dont know which version is this]. That website runs successfully on the machine having visual studio[As in that i just attach my database through the GUI provided by VS]. Now I want to deploy that website on a LAN. I have the database in .ldf and .mdf format. But I dont know whether it is in sql 2005 or sql 2008[as i made it through Visual Studio GUI] Now the system in which i have to deploy cannot have a licensed product. So i have to convert that database either to open source or an free version of sql server. I chose to go for SQL Server express edition that is free. Now the prolem being whether I use SQL Server 2008 or 2005 as i dont know which database was provided by the VS.[when i made that databse] But the problem being that on the system in which i have to deploy does not contain VS. Supposing it provides SQL Server 2005 express edition I permormed the following test:- Now i have installed .NET framework 3.5, MS SQL server 2005 Express Edition and the SQL Server management studio that is a GUI for handling d/b. Now when I attached that database[that i have, of which i dont have the version]. I can see the database and tbles and all the contents that was there in the d/b.[through that management studio GUI]. Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:- 1> The database that i have is in SQL server 2008 express edition or something else. 2> I have to make some changes in the connectivity[in web.config or some other location] NOTE: Also when i connected the d/b in management stuio it shows all the tables with dbo as a prefix. for eg. suppose i had a table as User_Master than its showing as dbo.User_Master. please guide me if u can. Waiting for ur reply.
modified on Wednesday, October 6, 2010 3:23 AM
Let me Answer your Questions You wrote : Now I want to deploy that website on a LAN. I have the database in .ldf and .mdf format. But I dont know whether it is in sql 2005 or sql 2008[as i made it through Visual Studio GUI]
The only way to Find out is to attach it on an SQL Instance,First try to attach it in an SQL 2005 instance, if its a SQL 2008 then it will give you an error that has something like
"bla bla bla does not belong to ...Family ...."
and if you are able to attach it then it means its 2005
You wrote : Now the system in which i have to deploy cannot have a licensed product. So i have to convert that database either to open source or an free version of sql server.
The SQL Express is good for your requirement, i dont think you need to do some conversion, as long as you have SQL Express instance installed on your machine you can just attach your files
You wrote : But the problem being that on the system in which i have to deploy does not contain VS.
You dont need visual Studio , you need to Install the SQL instance. That will have SQL Management studio to attach your Files
You wrote : Now i have installed .NET framework 3.5, MS SQL server 2005 Express Edition and the SQL Server management studio that is a GUI for handling d/b. Now when I attached that database[that i have, of which i dont have the version]. I can see the database and tbles and all the contents that was there in the d/b.[through that management studio GUI].
if you could do this then its not a 2008 mdf files, you can still confirm by "Right click on your Database and go to properties and select the "Options" and check the Version from there.
You wrote : Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-
How do you know that you cant connect , if you cant see the error ?
You wrote : 2> I have to make some changes in the connectivity[in web.config or some other location] what is your Question Regarding this ?
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.z
-
Let me Answer your Questions You wrote : Now I want to deploy that website on a LAN. I have the database in .ldf and .mdf format. But I dont know whether it is in sql 2005 or sql 2008[as i made it through Visual Studio GUI]
The only way to Find out is to attach it on an SQL Instance,First try to attach it in an SQL 2005 instance, if its a SQL 2008 then it will give you an error that has something like
"bla bla bla does not belong to ...Family ...."
and if you are able to attach it then it means its 2005
You wrote : Now the system in which i have to deploy cannot have a licensed product. So i have to convert that database either to open source or an free version of sql server.
The SQL Express is good for your requirement, i dont think you need to do some conversion, as long as you have SQL Express instance installed on your machine you can just attach your files
You wrote : But the problem being that on the system in which i have to deploy does not contain VS.
You dont need visual Studio , you need to Install the SQL instance. That will have SQL Management studio to attach your Files
You wrote : Now i have installed .NET framework 3.5, MS SQL server 2005 Express Edition and the SQL Server management studio that is a GUI for handling d/b. Now when I attached that database[that i have, of which i dont have the version]. I can see the database and tbles and all the contents that was there in the d/b.[through that management studio GUI].
if you could do this then its not a 2008 mdf files, you can still confirm by "Right click on your Database and go to properties and select the "Options" and check the Version from there.
You wrote : Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-
How do you know that you cant connect , if you cant see the error ?
You wrote : 2> I have to make some changes in the connectivity[in web.config or some other location] what is your Question Regarding this ?
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.z
Hi vuyiswa, Thanks for giving so much time i reading this and giving the reply.
You wrote :
Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-How do you know that you cant connect , if you cant see the error ?
Because when i enter hte username and password that there in the database table User_Master[that has been converted to dbo.User_Master] , i cannot loog on to. Inspite it redirects me to the locgin page again. Also I cannot debug the prog as i dont have VS 2008. To check this whats happening , i tried one thing:- On login page [in coding,aspx.cs page], i commented the line which checks whether the username and password is valid or not [ which fetches data from the database] and simply redirected to the Homepage.aspx. It works fine. On one page [in coding,aspx.cs page], i commented the line which checks whether the session for userlogin is there or not[in login page if the user is authenticated i have saved his username in session and checked this session on everypage , if the session is not null then only user can see that page]. So now when i browse that page through IIS server the page is opening(ofcourse, it will) i enter all the data in the text fields. When i submit the button [which enters the data to the tables] it gives me that dirty yellow page. [as i said earlier i cannot debug the programme without VS or there is any way]
You wrote :
Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-How do you know that you cant connect , if you cant see the error ?
Because if it connects then there is some problem related with database, and if there is some problem with database then i have redirected it to the Error.aspx page.
You wrote :
2> I have to make some changes in the connectivity[in web.config or some other location]what is your Question Regarding this ?
As now i am not using the default D/B provided by the VS2008 and using SQL Server 2005 express edition, so are there any changes i
-
Hi vuyiswa, Thanks for giving so much time i reading this and giving the reply.
You wrote :
Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-How do you know that you cant connect , if you cant see the error ?
Because when i enter hte username and password that there in the database table User_Master[that has been converted to dbo.User_Master] , i cannot loog on to. Inspite it redirects me to the locgin page again. Also I cannot debug the prog as i dont have VS 2008. To check this whats happening , i tried one thing:- On login page [in coding,aspx.cs page], i commented the line which checks whether the username and password is valid or not [ which fetches data from the database] and simply redirected to the Homepage.aspx. It works fine. On one page [in coding,aspx.cs page], i commented the line which checks whether the session for userlogin is there or not[in login page if the user is authenticated i have saved his username in session and checked this session on everypage , if the session is not null then only user can see that page]. So now when i browse that page through IIS server the page is opening(ofcourse, it will) i enter all the data in the text fields. When i submit the button [which enters the data to the tables] it gives me that dirty yellow page. [as i said earlier i cannot debug the programme without VS or there is any way]
You wrote :
Now i have deployed my website on IIS also and when i browse my page i can see it on the browser but ....... I am not able to connect to the database tables as when i enter the login and password it comes to the same login page again without showing any error. Now, I cannot identify whether its due to the following reason:-How do you know that you cant connect , if you cant see the error ?
Because if it connects then there is some problem related with database, and if there is some problem with database then i have redirected it to the Error.aspx page.
You wrote :
2> I have to make some changes in the connectivity[in web.config or some other location]what is your Question Regarding this ?
As now i am not using the default D/B provided by the VS2008 and using SQL Server 2005 express edition, so are there any changes i
I don't think problem with db connections.... if u think so try to install Fx SDK and debug ur code using CLR Debugger or else write a single test page with complete diagnostic.
-
I don't think problem with db connections.... if u think so try to install Fx SDK and debug ur code using CLR Debugger or else write a single test page with complete diagnostic.
hi Murugesan, thanks for ur response but can u just explain the points that i made in the previous quote. also there are many Fx SDK versions available like Java win SDK....which to download and install and is it free? as for rules cannot install the licensed version. What do you mean by
write a single test page with complete diagnostic.
Thanks.
-
hi Murugesan, thanks for ur response but can u just explain the points that i made in the previous quote. also there are many Fx SDK versions available like Java win SDK....which to download and install and is it free? as for rules cannot install the licensed version. What do you mean by
write a single test page with complete diagnostic.
Thanks.
.Net framework SDK, which is free and download it from SDK Link
write a single test page with complete diagnostic.
For isolating the problem write a server side page to connect database.
-
.Net framework SDK, which is free and download it from SDK Link
write a single test page with complete diagnostic.
For isolating the problem write a server side page to connect database.
hi , how to connect to the database and how to provide the GUI as I said that i dont have VS. Please cant u favour me just give me some hint for login only ... also below please find my login coding... login.aspx.cs
protected void btnLogin_Click(object sender, EventArgs e) { if (Session["Admin"] != null) { if (txtPassword.Text.ToUpper.Equals(Session["Admin"])) Response.Redirect("Homepage.aspx"); } String except = null; DataValidation dv = new DataValidation(); String pass = txtPassword.Text; String password = null; password = dv.loginIn(txtUserName.Text); if (password==null) { //Session["Exception"] = except; Session["SourceFile"] = Formname; Response.Redirect("Error.aspx"); txtUserName.Text = "Exception"; } else if (password.Equals(pass)) { //txtUserName.Text = "Success"; Session["User"] = txtUserName.Text; if (Session["User"].ToString().ToUpper().Equals("ADMIN")) Session["Admin"] = "ADMIN"; Response.Redirect("Homepage.aspx"); } else { lblCheck.Text="Invalid UserName or Password"; //Response.Redirect("LogIn.aspx"); } }
the DataValidation function[this is one .cs file i have maintained for data validation]public String loginIn(String userName) { String queryBuilder; { DataBaseConnection ds = new DataBaseConnection(); queryBuilder = "SELECT Password FROM User_Master WHERE UserName = @uname"; String pass = ds.loginDataBase(userName, queryBuilder); return pass; } }
the DataBase connection functionSqlConnection getConnection() { SqlConnection cn = null; { cn = new SqlConnection(); cn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); return cn; } } public String loginDataBase(String userName, String queryBuilder) { SqlConnection sqlcon = null; try { sqlcon = new SqlConnection(); sqlcon.ConnectionS
-
hi , how to connect to the database and how to provide the GUI as I said that i dont have VS. Please cant u favour me just give me some hint for login only ... also below please find my login coding... login.aspx.cs
protected void btnLogin_Click(object sender, EventArgs e) { if (Session["Admin"] != null) { if (txtPassword.Text.ToUpper.Equals(Session["Admin"])) Response.Redirect("Homepage.aspx"); } String except = null; DataValidation dv = new DataValidation(); String pass = txtPassword.Text; String password = null; password = dv.loginIn(txtUserName.Text); if (password==null) { //Session["Exception"] = except; Session["SourceFile"] = Formname; Response.Redirect("Error.aspx"); txtUserName.Text = "Exception"; } else if (password.Equals(pass)) { //txtUserName.Text = "Success"; Session["User"] = txtUserName.Text; if (Session["User"].ToString().ToUpper().Equals("ADMIN")) Session["Admin"] = "ADMIN"; Response.Redirect("Homepage.aspx"); } else { lblCheck.Text="Invalid UserName or Password"; //Response.Redirect("LogIn.aspx"); } }
the DataValidation function[this is one .cs file i have maintained for data validation]public String loginIn(String userName) { String queryBuilder; { DataBaseConnection ds = new DataBaseConnection(); queryBuilder = "SELECT Password FROM User_Master WHERE UserName = @uname"; String pass = ds.loginDataBase(userName, queryBuilder); return pass; } }
the DataBase connection functionSqlConnection getConnection() { SqlConnection cn = null; { cn = new SqlConnection(); cn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); return cn; } } public String loginDataBase(String userName, String queryBuilder) { SqlConnection sqlcon = null; try { sqlcon = new SqlConnection(); sqlcon.ConnectionS
Try to throw an exception and see the message... if ur not getting any exception then simply check the database table has rows or not.
catch (Exception ex)
{
// except = ex.ToString();
throw;
} -
Try to throw an exception and see the message... if ur not getting any exception then simply check the database table has rows or not.
catch (Exception ex)
{
// except = ex.ToString();
throw;
}hey u deleted your mail ID , i have to mail u that code , and i have used that exception, i am redirecting to Error.aspx if any error comes. you once again give me ur mail id thanks
-
hey u deleted your mail ID , i have to mail u that code , and i have used that exception, i am redirecting to Error.aspx if any error comes. you once again give me ur mail id thanks