I have 2 identical sql servers one of which is linked to the other via a linked server config which for one particular query gives back the error I give in the subject of this thread:
java.sql.SQLException: Could not get the data of the row from the OLE DB provider 'SQLOLEDB'
if I run the exact same sql string in query analyser it runs with no problem.
if have similar queries also running from java which use the linked server and these do not give an error. I am at a loss as to explain why this is happening.
the query in question joins together a number of views which reference the linked server.
I have tried everything I can think of including recreating the views and linked server definition.
If all is OK in query analyser, how can it fail when called over jbdc (especially when all other db requests succeed) ?
Hello,I'm struggling a giant fight with my webprovider (ASP.net 2.0) in the following case:I'm using the default connectionstring which automatic is provided when I create an ASP.net webstarterskit. This connectionstring is working fine when i deployed that kit to a W2003 server testenvironment and is also running on my laptop. But when I tried to deploy the website to my (new) hostingserver, also a W2003 server, I landed in ERROR-land. The last error I received was:Cannot open database "Club" requested by the login. The login failed.> Login failed for user 'NT AUTHORITYNETWORK SERVICE'.NB: I gave that user the right privileges and roles. My provider is not willing in sending me an example of a good working connectionstring and is directing me to their FAQ-site in which the right connectionstring is mentioned. That string looks like this (for a MS SQL database):strConnectie = "Provider=SQLOLEDB;" & _ "Data Source=(local)SQLEXPRESS;" & _ "Initial Catalog=[GEBRUIKERSNAAM];" & _ "User Id=[GEBRUIKERSNAAM];" & _ "Password=[WACHTWOORD]"My connectionstring in web.config looks like this:<connectionStrings><clear/><add name="ClubSiteDB" connectionString="Data Source=.SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|Club.mdf;User Instance=True" providerName="System.Data.SqlClient"/><remove name="LocalSqlServer"/><add name="LocalSqlServer" connectionString="Data Source=.SQLEXPRESS;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" /></connectionStrings>Is there anybody in this forum that can help me out and explain to me how to use the string, as provided by the host, in the default connectionstring i use in web.config ??Any help is welcome and appreciated.NB: I'm using VWD 2005 Express Edition and SQL Server Management Studio ExpressHarry Elzinga
if we see provider=sqloledb in the connection string of a legacy sql server 2000/2005 system we're trying to understand better, can we conclude that ODBC is definitely not in the client picture, that possibly OLEDB is and that SQL Native isnt? Can we conclude for sure what middleware must be in use?
My limited understanding of this "middleware" space is that ODBC is old and restrictive, OLEDB is a lot more state of the art and general, and that SQL Native is more proprietary than OLEDB.
Even if we can conclude what middleware must be in use, is it generally as simple as changing a connection string and ensuring installation of the preferred middleware in upgrading to better performing middleware?
I am getting following Error: Oracle linked server in SQL server 2005 to update tables in Oracle database. I have used OPENQuery to update tables in Oracle from a SQL Server 2005 Stored procedure.
If we run query from sql management studio for inserting or updating table of linked server then it runs fine. But if we use Begin distributed transaction then its gives error -
Server: Msg 7391, Level 16, State 1, Procedure sp_test, Line 105 The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction. [OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ] OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a]. We are using Sql server stored procedure to run the open query syntax for updating oracle interface table.
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction. [OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ] OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].
I have a Insert statement which i am using to insert data into a remote server from my local server. I have added the remote server as a linked server in my local server but when i try to execute the statement i am getting the above mentioned error. I am using Windows Enterprise Edition 2003 and SQL Server 2000.
I have also enabled the Allow InBound and Allow OutBound in the security configuration of My Computer properties but still i am facing the same problem. Kindly let me know how to resolve this issue.
Hi, I was making a linked server connection between 2 SQL Server 2000 servers (both running on Windows 2003 Server), and I was creating an insert trigger in one of the SQL Server table to insert the same value to the other SQL table. But when I try to make an insert to the table, the following error occurred :
Server: Msg 7391, Level 16, State 1, Procedure <triggername>, Line xx The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction. [OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ] OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].
I tried to change the trigger into a SELECT statement only and the error still occurred. But when I tried to insert a row directly to the linked server via Query Analyzer, it succeeded. I have read KB 280106, KB 306212, and KB 329332, and I've tried SET XACT_ABORT ON statement, but none of them can solve the problem. If there's anyone who has idea on what's wrong or has a suggestion what I should try please help. Thank you in advance.
Window Server 2003 R2 Standard Edition (x64) SP1 Sql Server 2000 8.00.2039 SP4 Enterprise Edition (32 bit version)
A linked server is configured to a sql 2000 server and when I execute sql statement SELECT * FROM [LinkedServer].[Database].[dbo].[TableName] it gives following error message: -
Server: Msg 7399, Level 16, State 1, Line 1 OLE DB provider 'SQLOLEDB' reported an error. The provider did not give any information about the error. OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IUnknown::QueryInterface returned 0x80004005: The provider did not give any information about the error.].
In case if anyone has a solution to it, please let me know.
can someone help me in this???? this function is throwing exception "sqlException unhandled in user code"."incorrect syntax near ?"
Public Overrides Sub UpdateUser(ByVal us As System.Web.Security.MembershipUser) Dim conn As New SqlConnection(connStr) Dim cmd As New SqlCommand("UPDATE users SET firstname = ?, lastname = ?, company= ?, address= ?, state= ? WHERE Username = ?", conn) Dim u As User = CType(us, User) cmd.Parameters.Add("@firstname", SqlDbType.VarChar, 50).Value = u.FirstName cmd.Parameters.Add("@lastname", SqlDbType.VarChar, 50).Value = u.LastName cmd.Parameters.Add("@company", SqlDbType.VarChar, 50).Value = u.Company cmd.Parameters.Add("@address", SqlDbType.NVarChar, 200).Value = u.Address cmd.Parameters.Add("@state", SqlDbType.VarChar, 50).Value = u.State cmd.Parameters.Add("@Username", SqlDbType.NVarChar, 64).Value = u.UserName Try conn.Open() cmd.ExecuteNonQuery() Catch e As SqlException Throw e 'Throw New Exception("Some Error occured during updation...") Finally conn.Close() End Try End Sub
I think this might be a good place to ask the following question.
I am writing the error handling code for my data access layer for a web application. I am using the Enterprise Library Data Access Application Block. Although this supports generic database connections, I realized that I need to handle errors specific to each database type. Microsoft SQL is the only database type I am using for now, so I am using a try...catch (SqlException e).
In testing my code, I intentionally changed the instance name in web.config to a name that does not exist. I get the very popular error 26 - Error Locating Server/Instance Specified. This is returned as a SqlException, but the SqlError.Number property is set to -1.
Am I getting "-1" because the provider hasn't actually connected to SQL yet, so it doesn't have an actual SQL error number? Can I assume that (SqlError.Number == -1) is always a fatal, provider-level connection exception? Will the provider ever use another SqlError.Number of its own? Or do all numbers besides -1 come from the SQL sysmessages table?. Is there a comprehensive list of what exceptions might be raised by the SqlClient provider, including #26?
The reason for all the questions is that in a web application, I want to prevent the end-user from seeing the "real" exception if it has to do with configuration errors. However, maybe there are other errors that the user should see and handle? It's hard to know without a full list of SqlClient provider errors, along with the SqlError.Number that each error maps to.
I am using a stored procedure which returns a value of charecter datatype 'V' to the calling program.I am getting an sql exception System.Data.SqlClient.SqlException: Syntax error converting the varchar value 'V' to a column of data type inti didnot define any int datatype in my tablethis is my codeSqlCommand com = new SqlCommand("StoredProcedure4", connection);com.CommandType = CommandType.StoredProcedure; SqlParameter p1 = com.Parameters.Add("@uname", SqlDbType.NVarChar);SqlParameter p2 = com.Parameters.Add("@opwd", SqlDbType.NVarChar);SqlParameter p3 = com.Parameters.Add("@role", SqlDbType.NVarChar);p3.Direction = ParameterDirection.ReturnValue;p1.Value = username.Text.Trim();p2.Value = password.Text.Trim();com.ExecuteReader();lblerror2.Text = (string)(com.Parameters["@role"].Value); can your figure out what is the error ? Is it a coding error or error of the databse
I am new to ASP.NET and trying to learn. I am getting the problem when I try to insert data into SQL. The exception that I am getting is
Exception Details: System.Data.SqlClient.SqlException: An explicit value for the identity column in table 'Customers' can only be specified when a column list is used and IDENTITY_INSERT is ON.
My table name is 'Customers' and its as below. ----------------------------------------------------------------------- CustomerID--numeric---Identity Seed is 1000---Identity Increment is 1---No Nulls. Name--------varchar---No Nulls. address------Varchar---No Nulls. State--------Varchar---No Nulls. Zip-----------VarcHar---No Nulls. PhoneNumber-Varchar---No Nulls. Email---------Varchar---No Nulls.
and my code is (No fun of my code please--I am a learner) -----------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class register
Inherits System.Web.UI.Page
Protected WithEvents cnNWind As SqlConnection
'Protected drCustomers As SqlDataReader
Protected WithEvents lbladd As System.Web.UI.WebControls.Label
Protected WithEvents lblState As System.Web.UI.WebControls.Label
Protected WithEvents lblcity As System.Web.UI.WebControls.Label
Protected WithEvents lblzip As System.Web.UI.WebControls.Label
Protected WithEvents lblPhone As System.Web.UI.WebControls.Label
Protected WithEvents lblEmail As System.Web.UI.WebControls.Label
Protected WithEvents TxtName As System.Web.UI.WebControls.TextBox
Protected WithEvents txtAdd As System.Web.UI.WebControls.TextBox
Protected WithEvents txtState As System.Web.UI.WebControls.TextBox
Protected WithEvents txtCity As System.Web.UI.WebControls.TextBox
Protected WithEvents txtZip As System.Web.UI.WebControls.TextBox
Protected WithEvents txtPhone As System.Web.UI.WebControls.TextBox
Protected WithEvents TxtEmail As System.Web.UI.WebControls.TextBox
Protected WithEvents BtnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub BtnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSubmit.Click
Dim cmCustomers As New SqlCommand("INSERT INTO Customers VALUES ('',' " & TxtName.Text & "','" & txtAdd.Text & "','" & txtState.Text & "','" & txtZip.Text & "','" & txtPhone.Text & "','" & TxtEmail.Text & "')", cnNWind)
cmCustomers.ExecuteNonQuery()
cmCustomers.ExecuteNonQuery()
cnNWind.Close()
End If
End Sub
End Class
The Error I am getting: ----------------------------------------------------------------------- Server Error in '/SCart' Application. --------------------------------------------------------------------------------
An explicit value for the identity column in table 'Customers' can only be specified when a column list is used and IDENTITY_INSERT is ON. 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.
Exception Details: System.Data.SqlClient.SqlException: An explicit value for the identity column in table 'Customers' can only be specified when a column list is used and IDENTITY_INSERT is ON.
Source Error:
Line 46: If cnNWind.State = ConnectionState.Open Then Line 47: Dim cmCustomers As New SqlCommand("INSERT INTO Customers VALUES ('','" & TxtName.Text & "','" & txtAdd.Text & "','" & txtState.Text & "','" & txtZip.Text & "','" & txtPhone.Text & "','" & TxtEmail.Text & "')", cnNWind) Line 48: cmCustomers.ExecuteNonQuery() Line 49: cnNWind.Close() Line 50: End If
[SqlException: An explicit value for the identity column in table 'Customers' can only be specified when a column list is used and IDENTITY_INSERT is ON.] System.Data.SqlClient.SqlCommand.ExecuteNonQuery() SCart.register.BtnSubmit_Click(Object sender, EventArgs e) in d:inetpubwwwrootSCart egister.aspx.vb:48 System.Web.UI.WebControls.Button.OnClick(EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain()
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
The code works fine If I Dont use Identity Column, But I need to use Identity Column in my Project :( ...Please Help.
I'm trying to retrieve an image from my ms sql server 2005, and i'm using VS2005....however, i have the following error during the compilation process Code in webform2.aspx.vb:Partial Class webform2 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim connstr As String = "Data Source=DCPRJ007SQLEXPRESS;Initial Catalog=mydatabase;Integrated Security=True" Dim cnn As New Data.SqlClient.SqlConnection(connstr) Dim cmd As New Data.SqlClient.SqlCommand("select * from dbo.images where id=" & Request.QueryString("id"), cnn) cnn.Open() Dim dr As Data.SqlClient.SqlDataReader = cmd.ExecuteReader() Dim bindata() As Byte = dr.GetValue(1) Response.BinaryWrite(bindata) End SubEnd Class System.Data.SqlClient.SqlException was unhandled by user code Class=15 ErrorCode=-2146232060 LineNumber=1 Message="Incorrect syntax near '='." Number=102 Procedure="" Server="DCPRJ007SQLEXPRESS" Source=".Net SqlClient Data Provider" State=1 StackTrace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader() at webform2.Page_Load(Object sender, EventArgs e) in C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005WebSitesWebSite7webform2.aspx.vb:line 10 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I have implemented a package, which loads data from a flat file into an OLE DB destination. I have added the properties of the OLE DB Connection Manager to the package configuration (XML file), in order to give me enough flexibility for running the package on different databases.
Now I wanted to integrate my package into the application that would call it and I ran into these problems.
A. Call a package from a JAVA application: I have a JAVA web application, which should provide the source file and finally trigger the load operation.
A1: How can I execute a package from within a JAVA application?
A2: How can I pass parameters to this package?
B. Parallel Package Execution: If I was able to trigger the package execution from my application, then I can encounter a situation where the package is triggereed to be executed again with different input data before the first package has finished.
B1: Is it possible (from SSIS point of view) that the same package gets executed parallely with different input?
C. Run the package against several databases: Assuming that I have 5 databases where I load data using this package. I have created 5 configuration.xml files with the corresponding DB connection properties.
C1: How can I tell the package which configuration file to read from, in order to load the source data into the correct destination? Is it possible to pass the path of the configuration.xml file when executing a package?
Hi All, I have a form (asp website with the default.aspx and default.aspx.cs) which I use to connect to the SQL Server 2005 database and insert, update,get and delete data to and from it. In the table I have a column called Picture to insert a photo (usually bmp files) which I declared as a varbinary(max). ID is the primary key and is an int (i tried it to be numeric & varchar). I am trying to insert data into the table using a form with this syntax: SqlConnection enter_conn = new SqlConnection("user id=;" + "password=;server=servername;" + "Trusted_Connection=yes;" + "database=Member Profiles; " + "connection timeout=30"); enter_conn.Open(); string insertSql = "Insert dbo.Details(ID,Last_Name,First_Name,Middle_Initial,Project, Organization,Manager,Current_Skills,Biography,Hobbies, Picture) Select 1001, 'ABC','XYZ','R',' Website Development','ACT',LKM','ASP.Net, C#.Net, SQL Server 2005, SharePoint, Java, ',' developing the new website for ACT using SharePoint and SQL Server 2005', ' Singing, Listening to Music, Dancing, Cooking, Swimming', BulkColumn from Openrowset( Bulk 'C:\photos\rose.bmp', Single_Blob) as Picture";
SqlCommand myCommand = new SqlCommand(insertSql, enter_conn); int i = myCommand.ExecuteNonQuery();
I have no data in the table and am doing the first insert. Though the data gets inserted I am getting this exception: System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_Details'. Cannot insert duplicate key in object 'dbo.Details'. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at _Default.Enter_Click(Object sender, EventArgs e) in c:Documents and SettingskrkondaXMy DocumentsVisual Studio 2005WebSitesMember ProfilesDefault.aspx.cs:line 82
Can someone please suggest anything???? I appreciate a quick response please!!!!
I am getting this error message System.Data.SqlClient.SqlException: Invalid object name 'RacingHeritage' I have noticed from other posts where the database owner is the login name I rebuilt the table and the owner is now dbo Here is the Code Function GetCustomers() As System.Data.DataSet Dim connectionString As String = Application("HiddenConnection") Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString) Dim queryString As String = "SELECT [RacingHeritage].[RHID], [RacingHeritage].[UserID], [RacingHeritage].[Clie"& _ "ntFirstName] FROM [RacingHeritage]" Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand dbCommand.CommandText = queryString dbCommand.Connection = dbConnection Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter dataAdapter.SelectCommand = dbCommand Dim dataSet As System.Data.DataSet = New System.Data.DataSet dataAdapter.Fill(dataSet) Return dataSet End Function Any Ideas
Hello, we have asp.net apps on a windows 2003 server that connect to an instance of sql server 2005 enterprise edition on another windows 2003 server. We get this error at random times. Anyone know what could be causing it?
System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Data.SqlClient.SqlException: SSL Security error. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open()Thanks
I keep getting this error whenever I try to run my query: System.Data.SqlClient.SqlException: Incorrect syntax near '>'. I'm just trying to fill a dataset with three tables that contain the past few days headlines...what am I doing wrong?? Private Sub fishHeadlines() Dim dateNow As DateTime = DateTime.Now()Dim dateThen As DateTime = DateTime.Today.AddDays(-2) 'create the table array so we can create the sql statement in a moment Dim table() As Stringtable = New String() {"Snapper", "Scissor", "MahiMahi"} Dim strSelect As String 'Create a dataset to hold the tables containing the headlinesDim headlinesDS As New DataSet() 'create the connection string - SnapshotConnectionString is in web.config file Dim strConnect As StringstrConnect = ConfigurationManager.ConnectionStrings("fishConnectionString").ConnectionString 'create a connection object to the databaseDim objConnect As New SqlConnection(strConnect) objConnect.Open() Dim i As Integer 'fill the datatablesFor i = 0 To table.Length strSelect = "SELECT Event FROM " & table(i) & "WHERE (DateOfEntry > '" & dateThen & "')" 'create a data adapter object using connection and sql statementsDim objDA1 As New SqlDataAdapter(strSelect, objConnect) 'fill the dataset objDA1.Fill(headlinesDS, table(i)) Next Dim strTable As StringDim dr As DataRow strTable = "<table>"For i = 0 To table.Length For Each dr In headlinesDS.Tables(table(i)).Rows strTable += "<tr><td>" & dr(0).ToString() & "</td></tr>" Next Next strTable += "</table>" 'display the data lblHeadlines.Text = strTable End Sub
Hi there, i copied some insert code from one page to another and it keeps throwing me this error, i was wondering if anyone can help me out. Here is the error System.Data.SqlClient.SqlException: The name "Credit" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Admin_expenses.Button1_Click(Object sender, EventArgs e) in d:hostingmemberashdfhtdocswwwAdminexpenses.aspx.cs:line 40 This is my code, i cant see anything obvious and as i said i just copied it across, the only things changed were the names and the sqlstringprotected void Button1_Click(object sender, EventArgs e) {decimal intamount = Convert.ToDecimal(txtAmount.Text); string sConnectionStringExpense = "Data Source=xxxx;Initial Catalog=xxxx;User ID=xxxx;Password=xxxx";SqlConnection objConnExpense = new SqlConnection(sConnectionStringExpense); using (objConnExpense) { objConnExpense.Open();string sqlExpense = "INSERT INTO tbl_expenses (expense_amount, expense_payment_type, expense_type, expense_description) " + "VALUES (" + intamount + "," + ddlPaymentType.SelectedItem + "," + ddlExpenseType.SelectedValue + "," + txtDescription.Text + ")";SqlCommand objCmdExpense = new SqlCommand(sqlExpense, objConnExpense); try { objCmdExpense.ExecuteNonQuery(); }catch (Exception ex) {lblcomplete.Text = "!!Adjust stock for product at location " + Convert.ToString(ex); } finally { objConnExpense.Close(); } }
We are developing Asp.Net Application in following environment.
Windows 2003 Dot Net 2003 SQL Server 2000
Problem :
We have team of four people. We made one machine as database server and rest of the people trying to connect to that database server. we are getting error "SQL server not found.".
We are using following string as a connection string.
I am getting the exception -System.Data.SqlClient.SqlException: Timeout expired.The timeout period elapsed prior to completion of the operation or the server is not respondingWhen I am executing the stored procedureHow to resolve this?
We have some big problems with our SQL Server 2000 database right now. The code has not been changed for over halv an year and some days ago we started to get this error.
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Both web and database server is running fine. Any help is appreciated!
(We are now pretty sure that all errors occurs when we are doing inserts to the database.)
I am not sure it is the right forum. The Exception is thrown in C# app while saving a few databases. Small databases are being saved OK but this one has 12,934,142KB after the last backup. I am not even sure what the words "last backup" mean in this case. It is possible that is the size of the database from two months ago when first the problem appeared. Since then I've neglected backup being preoccupied with other problems although the database grew.
The backup is executed by this store procedure:
USE [hist_OHLC] GO
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO
ALTER PROCEDURE [dbo].[backUphist_OHLC] AS BEGIN SET NOCOUNT ON; ALTER DATABASE hist_OHLC SET RECOVERY FULL BACKUP DATABASE hist_OHLC TO DISK = 'L:SQLServerBackupshist_OHLChist_OHLCFullRM.bak' BACKUP LOG hist_OHLC TO DISK = 'L:SQLServerBackupshist_OHLChist_OHLCFullRM.log'; END
What can I do about it? What is the rational way of backing up databases of this size?
What is the rational way of maintaining databases of this size in SQLEXPRESS? Shall I perhaps break this database down into fragments?
The tables contain daily records, about 500 per day. I can conceivably create another database every month or so but it will be a hassle.
How can I increase the timeout?
I just repeated the backup. All databases have been saved except this last one--Imoved that backup operation down the chain to be the last one. One database with about 1.5GBytes was saved fine.
I checked the timeout it is 15 sec. One has not control over it in C#. It does not have a Set option.
15
MyHandler caught : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
we have asp.net apps on a windows 2003 server that connect to an instance of sql server 2005 enterprise edition on another windows 2003 server. We get this error at random times. Anyone know what could be causing it?
System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Data.SqlClient.SqlException: SSL Security error. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() Thanks
Hello, we have a fairly large .NET application that uses MSSQL Server 2005 Express.
I am getting the following error loggged to our error log somewhat often:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
IIS and MSSQL server are on the same box, and talk locally. The server box is NOT losing internet so that is not the problem.
What could be causing this? Is this because we don't have enough system resources on the server, meaning CPU, RAM? Or is it poorly written ASP.NET or missing configuration information in the web.config file?
Hi guys, Everything seems to be fine, can browse the DB from VS, Preview data works fine in dataset, and the page works fine before adding any SQL DB code. I draged n dropped a new DropDownList, Bind it to an object from dataset. And when I want to run the page I get this error !!!
i was deleting a row from my gridview.this fail ("System.Data.SqlClient.SqlException: Invalid object name 'MESSAGE'.") consists what must i do ?My SQL query is "UPDATE MESSAGESET DELETIONSTATUSTO = 1,_LASTMODIFYDATE =getdate() WHERE (_ID = @ID)"
Hi, I am getting an time out expired error while import dbf files to the database.. In this upload one file had 379 records.. and it inserts it into the few tables and then i get the above error..in my event viewer. Error: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. No Changes made to the Plan table. Inserting records(s) in Plan table. No Changes made to Plan table. Updating changes to PlanStatementInfo. Updated 1 record(s) in PlanStatementInfo. Inserting new records into PlanStatementInfo. No new records were added to PlanStatementInfo. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, String spName, Object[] parameterValues) at icc.BaseClasses.DL.DLImportPlan.Import(Int32 ClientId, Int32 PeriodId, Int32 UserId) in C:Documents and SettingsMy DocumentsPlanStatementsImportDLDLImportPlan.cs:line 116
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.cs:line 116 --this is where i am calling my sproc... any help will will appreciated Thanks, Karen
I have a stored procedure to validate the data from the table CREATE PROCEDURE [dbo].[proc_Validate_BLDG] @BLDGData varchar(50),@output int OUTAS BeginIf Exists (Select DISTINCT GBC FROM ServerName.Database.dbo.Table where GBC = @BLDGData) begin set @output = 1 end Else begin set @output = 0 end return @output endGO Also, I have a function in my asp.net pages to call the stored procedure Public Function BLDGLookup() As Integer 'Create a connectionDim objConn As SqlConnection objConn = GetConnection() 'Create a command object for the query Dim objCommand As New SqlCommand("proc_Validate_BLDG", objConn) objCommand.CommandType = CommandType.StoredProcedure Dim param As SqlParameter = Nothing Dim output As IntegerobjCommand.Parameters.AddWithValue("@BLDGData", strBLDGTextBox)param = objCommand.Parameters.Add("@output", SqlDbType.Int) param.Direction = ParameterDirection.Output Try objCommand.ExecuteNonQuery()output = Int32.Parse(objCommand.Parameters("@output").Value.ToString()) Catch ex As ExceptionDim ex2 As Exception = ex Dim errorMessage As String = String.EmptyWhile Not (ex2 Is Nothing) errorMessage += ex2.ToString() ex2 = ex2.InnerException End While Response.Write(errorMessage) Finally End TryReturn output objConn.Close() End Function However, when i put in code to call this function and return a value I am getting thsi error: System.Data.SqlClient.SqlException: Procedure 'proc_Validate_BLDG' expects parameter '@BLDGData', which was not supplied.