473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to connect database in asp.net after uploading website?

i have upload my website to net & also connect with server by connection string but how to upload my Database
I have created database in .net control panel and all have told me to restore my database(.mdf file) but then also it shows some error like
Expand|Select|Wrap|Line Numbers
  1.  
  2. Server Error in '/' Application.
  3.  
  4. Invalid object name 'mentors'.
  5.  
  6. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  7.  
  8. Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'mentors'.
  9.  
  10. Source Error: 
  11.  
  12.  
  13. Line 20:         _cmd.CommandType = CommandType.Text;
  14. Line 21:         _cmd.CommandText = "select * from mentors";
  15. Line 22:         _cmd.ExecuteNonQuery();
  16. Line 23:         DataTable _dt = new DataTable();
  17. Line 24:         SqlDataAdapter _da = new SqlDataAdapter(_cmd);
  18.  
  19. Source File: e:\HostingSpaces\rfucs\rfucs.com\wwwroot\mentors.aspx.cs    Line: 22 
  20.  
  21. Stack Trace: 
  22.  
  23.  
  24. [SqlException (0x80131904): Invalid object name 'mentors'.]
  25.    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
  26.    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
  27.    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
  28.    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
  29.    System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +192
  30.    System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +317
  31.    System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
  32.    mentors.Page_Load(Object sender, EventArgs e) in e:\HostingSpaces\rfucs\rfucs.com\wwwroot\mentors.aspx.cs:22
  33.    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
  34.    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
  35.    System.Web.UI.Control.OnLoad(EventArgs e) +99
  36.    System.Web.UI.Control.LoadRecursive() +50
  37.    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  38.  
  39.  
so plz help me......
Mar 11 '11 #1
1 2057
In order to solve this issue I suggest for you to implement one of the following suggestions :

1- Export you sqlserver database as a sql file then ask you host provider to restore it from that file.

2- If you are using the sqlserver express version you may just upload the file to the "database" folder in your host account that is located next to your "www" or "public_html" or "wwwroot".

I hope that I manage to help you .....

Ahmed Al-Naib
Mar 11 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ssp2000 | last post by:
We want to develop database driven website. because of enormous amount of data (300GB) customers's tech advisors are insisting on using SAN instead of any direct attached storage method. I want...
0
by: programer | last post by:
Can I use Activex (as vb) to connect database when I use vc.net.
3
by: venkatesh | last post by:
hai to everybody I need to know how to connect database ms access or oracle with c or c++? please if u know tell I am interested in doing project with c thanks in advance....
1
by: arun_kumar112 | last post by:
HI , I am new member of this comminity, let me introduce first, i am MCA final year student, doing a project on network system, and database . will you tell me how can we connect database (...
1
by: nagendra prasad | last post by:
how to connect database for visualbasic using ADO
6
by: sravan_reddy001 | last post by:
I am creating a website. where the data to be stored in my server. I had my webspace from some service provider. How can i connect the website and thee database. --website is deployed at webspace...
3
by: iedayah88 | last post by:
can sombody help me..after i create database in oracle.. what i must do to connect database and sql.. it's i must setup odbc first? is yes, how to setup odbc in localhost?
25
by: pereges | last post by:
Hello, I'm trying to build a database driven website for a library management system. The database is stored on a remote server which all of my team mates can access. I've installed MySQL, PHP and...
2
by: chetan ghadiya | last post by:
how to connect database in vb ?
1
by: rishiverma | last post by:
how to connect database create in sql server ,to my web site upload on domain.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.