.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Sql Database Problem

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :ASP.Net

I am currently working on visual studio 2008 , sql express 2005, i have copied .mdf and .ldf files , after i copied these files and try execute some existing stored procedure but exception is coming like " Failed to update database xxxxxxxxxxxxxxxxx.MDF" because the database is read-only",

I dont knw  what's wrong with this , i have executed same stored procedure in old .mdf and .ldf database , and its working fine . but in copied .Mdf , not working.

Could any one fix this exception please.......

View Complete Post

More Related Resource Links

WSS 3.0 - problem with moving the database


My company wants to move a database included with WSS 3.0 installation to a *separate* server.
We want to have the database completely separated, on a different computer, on SQL Server 2005 installation.

Unfortunately, I'm not sure If the sharepoint is configured as a "Web Front End" or  "Stand-alone".
All I know, everything currently is on the same computer, and we can connect to the live database using the following path: \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

The question is, how can we move the database to SQL Server 2005, on very different server, leaving the application untouched?

Quick summary, we currently have:

--- Server A: (WSS 3.0) + [windows internal database / SSEE (not sure!)] + DOMAIN X

and we want t

SQL 2005 Database Problem

When trying open up a report from a customer database.  I recieved the following error: Please contact technical support with the following information:   Error ID: ERHIG030000340 Error message: There was a problem with the SQL or table when trying to open the display The table name is "taOrderHistory" The SQL is: Underlying problem: Column 'taOrderHistory.OrderHistoryID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at RadWebNet.rwDataSupport.OpenData(String SQLIn, rwConnection ConnIn, OpenDSReturnType ReturnWhat, Int32 TimeOut, Object[] ParamsIn) in D:\Misc Projects\RadWeb\RadwebV4-7-1\rwData.v

Problem with Movie Database Application

Hi Im following MVC tutorials on ASP.net website..I have a problem at Movies database application found in http://www.asp.net/mvc/tutorials/create-a-movie-database-application-in-15-minutes-with-asp-net-mvc-cs  Listing 3 - Views\Home\Index.aspx----------------------------------------------------------------------------------------------I dont understand where "Model" refer to in this code <% foreach (var item in Model) { %>  Also im confusing with accessing the database fields using var item Please explaine me what is happening in this code.<% foreach (var item in Model) { %> <tr> <td> <%= Html.ActionLink("Edit", "Edit", new { id=item.Id }) %> | <%= Html.ActionLink("Details", "Details", new { id=item.Id })%> Movie Database Application

problem rename sharepoint 2010 search service application admin database

Hi all, i have a problem that hopefully someone has an answer to.  i am not too familiar with sharepoint so please excuse my ignorance. we have sharepoint 2010 on a windows 2008r2 server.  everything seems to work fine.  but as you know, the default database names are horrendous.  i have managed to rename all of them, except for the "search service application" admin database. the default is: Search_Service_Application_DB_<guid> the other 2 databases (crawl and property) were renamed without a problem. we are following the article from technet on how to rename the search service admin db (http://technet.microsoft.com/en-nz/library/ff851878%28en-us%29.aspx).  it says to enter the following command: $searchapp | Set-SPEnterpriseSearchServiceApplication -DatabaseName "new database name" -DatabaseServer "dbserver" however, i get an error about identity being null.  no big deal, i add the -Identity switch and the name of my search service application.  but the real problem comes the error it throws:   Set-SPEnterpriseSearchServiceApplication : The requested database move was aborted as the associated search application is not paused. At line:1 char:54 + $searchapp | Set-SPEnterpriseSearchServiceApplication <<<<  -Identity "Search Service Application" -DatabaseName "ShareP

Database connection problem in ASP.NET

Hello,            I m having a database problem that I couldnt identify. The IIS loses connection to database once in 3 weeks.  Once  you restart the IIS everything is normal. Looks like IIS is fine because i can go to static pages. When I go to a page that requires database connection I get this error: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - Either the application has not called WSAStartup, or WSAStartup failed. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)   Is this a connection string problem?. because without changing anything if I restart the webserver all is fine.  Is this a problem with application state?   It cant be at the sql server side as other applications on the machine work fine. There is something going on with IIS not sure what it is.   Any help would be appreiciated.   Thanks, Bharani      

Basic data type problem with database insert

Hi,I'm trying to write some values into a database, but I think there's an issue with the data types.  Here's what I've got: public static string Hello(string pageId, string inOut) { string itemId = ""; string period = ""; var cookie = HttpContext.Current.Request.Cookies["visitorGUID"].Value; SqlConnection conn; SqlCommand comm; conn = new SqlConnection(GlobalSettings.DbDSN); comm = new SqlCommand("INSERT INTO myTable (memberGUID) VALUES (@memberGUID);", conn); comm.Parameters.Add("@memberGUID", System.Data.SqlDbType.Text); comm.Parameters["@memberGUID"].Value = cookie; try { conn.Open(); comm.ExecuteNonQuery(); return "Item added: cookie = " + cookie + " / pageId = " + pageId + " / inOut = " + inOut + " / pageId = " + pageId + " / itemId = " + itemId + " period = " + period; } catch { return "Item caught: cookie = " + cookie + " / pageId = " + pageId + " / inOut = " + inOut + " / pageId = " + pageId + " / itemId = " + itemId + " period = " + period; } finally { conn.Close(); } } At the moment I'm just trying to insert the value of the cookie into the database as a test.  It works fine when I

Security problem with cross database chaining and stored procedures

I have a situation whereby ProcA exists on database A, but ProcA executes about 20 stored procedures scattered across different databases. To further complicate matters some procs that ProcA calls also call other procs in other databases, this then presents the problem of cross database chaining where you can’t really write to a database from a proc that resides in another database. I am wondering how I can get around this problem, I know I can simply let open cross database chaining and the problem will go away, the other option is to create a proxy which is very complicated and wouldn’t work in my environment. Is there any way around the problem.

DetailsView edit problem after changing database

Hello!I had a DetailsView control for editing records in a Access 2003 database. I transfered the database to MS SQL 2008 and using the same code does not work - after clicking edit nothing happens (no error) and the record is not updated.ASP code:<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <h2> Urejanje kontaktnih podatkov </h2> <p> <asp:TextBox ID="txtKontaktID" Visible="false" runat="server"></asp:TextBox> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:conKrik %>" ProviderName="<%$ ConnectionStrings:conKrik.ProviderName %>"  SelectCommand="SELECT tblKontakt.*, tblStranka.strSkrajsanNaziv FROM krik.tblKontakt INNER JOIN krik.tblStranka ON tblKontakt.StrankaID = tblStranka.StrankaID WHERE ([KontaktId] = @id)" UpdateCommand="UPDATE tblKontakt SET strIme = @strIme, strPriimek = @strPriimek, strPoslovnaEnota = @strPoslovnaEnota, strTelefon = @strTelefon, strFaks = @strFaks, strMobitel = @strMobitel, strEmail = @strEmail, rmkOpomba = @rmkO

Problem to save infopath form data in database.

Hi i have a win application which host infopath forms. i want to save infopath form data in database. to do this, in my table, i have xml dataType which store infopath form data. my problem is when i load xml form into string variable and save to database, i got this exception : XML parsing: line 1, character 38, unable to switch the encoding Here is my sample infopath form data in xml format : <?xml version="1.0" encoding="UTF-8"?><?mso-infoPathSolution solutionVersion="" productVersion="12.0.0" PIVersion="" href="file:///C:\Users\Hamed\Documents\customForm1.xsn" name="urn:schemas-microsoft-com:office:infopath:customForm1:-myXSD-2010-09-11T10-56-47" ?><?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?><my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-09-11T10:56:47" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-us"> <my:txtFirstName>b</my:txtFirstName> <my:txtLastName>c</my:txtLastName> <my:txtFatherName>d</my:txtFatherName> <my:txtNationalCode>e</my:txtNational

Database connectivity problem (sql server 2005)

I want to connect my database using my windows application. My database is on the server and i my connection string is something like that Data Source=;User ID=myUserID;pwd=MyPwd;Initial Catalog=MyDatabase When i  try to connect in my local network using this connection string this work fine Data Source=MyServerName;User ID=myUserID;pwd=MyPwd;Initial Catalog=MyDatabase These are my server setting Go to "SQL server 2005 Surface Area Configuration" Surface Area Configuration for Services and Connections In Configure Surface Area for localhost (chnage computer) 1)Click (chnage computer) 2)Then Select Computer Window open, Now checked the local computer -> OK View By Instance: 1)Database Engine -> Service Start 2)Database Engine -> Remote Connections -> Local and remote connections -> Using both TCP/IP and named pipes 3)SQL server Browser - > Service Start Apply - OK View By Component: 1)Database Engine -> Service Start 2)Database Engine -> Remote Connections -> Local and remote connections -> Using both TCP/IP and named pipes 3)SQL server Browser - > Service Start Apply - OK Now In SQL server Configuration Manager. Shared Memory   : Enabled TCP/IP   : Enabled Named Pipes : Enabled VIA  : Disabled Select Client Protocols in the left side. In the TCP/IP Properties these are my

Problem trying to attach database file to Microsoft SQL Server Management Studio

I was trying to attach a database to SQL Server MGT Studio and got an exception error.  The message stated that the database file I was trying to attach could not be opened because it was version 661.  The SQL Server shows to support version 655 and earlier.  It states that a downgrade path is not supported. Question:  Is there some download ; fix; I can make to SQL Server 2008 that will allow me to attach the version 661????  I am not technical at all.  Please speak slowly.  :)  Thanks

How To Update Database When The System Shut Down By Light Problem

Hi,I want to update the User LoggedIn Status to 'False', when the system shut down by light problem, or when the user click the 'Browser Close Button'Please help me in details.Thanks in advance.

problem in setup database membership

 Hello everyoneThe teeming seen on this video http://www.asp.net/general/videos/how-do-i-set-up-the-sql-membership-provider Which explains the addition of a database to the project AlympirchibBut as they applied to explain and I had a problem, he says, Stop the server failed to note that I have is the name of the device and the database and set the defaultNo one can tell me what is the solution or the requirements for the work thanks

Please solve the Database problem (calculate the in and out timing) screech Card in and out timings.

Hey, Dear Friends.. Goody, I need a help from you people. Those who know the more database(prosegers) please salve this problem. The following is my database table. In that, want to calculate each employee out time and in time. I mean how much hr they are spending out side of the company and how much hours they are spending inside of the company in that day. Thanks in Advance. SuraReddy. Emani empcode CardNo emp_code_name time IOGateNo Door in_out date 0022 0022 XYZ 09:09:50 02-1 MAIN DOOR(I/O) Entry 2010-09-08 0022 0022 XYZ 09:50:40 02-5 MAIN DOOR(I/O) Exit 2010-09-08 0022 0022 XYZ 10:02:31 02-1 MAIN DOOR(I/O) Entry 2010-09-08 0022 0022 XYZ 11:31:56 02-5 MAIN DOOR(I/O) Exit 2010-09-08 0022 0022 XYZ 11:45:25 02-1 MAIN DOOR(I/O) Entry 2010-09-08 0022 0022 XYZ 13:48:51 02-5 MAIN DOOR(I/O) Exit 2010-09-08 0022 0022 XYZ 14:30:25 02-1 MAIN DOOR(I/O) Entry 2010-09-08 0022 0022 XYZ 16:16:15 02-5 MAIN DOOR(I/O) Exit 2010-09-08 0022 0022 XYZ 16:33:27 02-1 MAIN DOOR(I/O) Entry 2010-09-08 0022 0022 XYZ 18:40:58 02-5 MAIN DOOR(I/O) Exit 2010-09-08 0022 0022 XYZ 09:04:41 02-1 MAIN DOOR(I/O) Entry 2010-09-09 0022 0022 XYZ 10:21:22 02-5 MAIN DOOR(I/O) Exit 2010-09-09 0022 0022 XYZ 10:30:06 02-1 MAIN DOOR(I/O) Entry 2010-09-09 0022 0022 XYZ 12:44:43 02-5 MAIN DOOR(I/O) Exit 2010-09-09 0022 0022 XYZ 09:08:24 02-1 MAIN DOOR(I/O) Entry 2010-09-14 0022 0022 XYZ 09:43:29 02-5

Binary Data Problem....save and retrive image data from sql database


hello friends...please help me to solve this problem....

i have created crud (create, retive, update and delete)form and it's running... here i want to add images for each record(sql database)....

i'm using image datatype in sql table for picture.....

Q 1: how to save and retrive binary data(image) from sql table in asp.net form using vb coding?

Q2: can i create sql table which store binary(image url) data direct?

thank you

DATABASE Restore Problem



I am restoring a backup file (size 300GB) of SQL 2005 in SQL 2008.

I tried all option.

Messages Showed Sucessfully Restored.

But Status is (Restoring) and database not in use.

Can You Please Help me out in this.

Option Tried : recovery, Norecovery and standby


Kunwar Naresh


SQL Agent Job Notification - Database Mail problem

I'm a little stumped. Have setup database mail on SQL Server 2008 (SP1 x64) and its working fine except when its supposed to send out a SQL Agent job notification.
I've enabled database mail on SQL Agent and have specified a profile, but when it tries to send an email on agent job completion it errors with "NOTE: Failed to notify '<operator>' via email."
Can anybody help?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend