Intermittent ExecuteReader Problems

Oct 26, 2006

I have VS 2005 and SQL CE 3.0. I sometimes get the a FileNotFoundException when I first use ExecuteReader. I believe this is because a dll has not been copied across because if I restart the emulator I can get it to work again.

Do I need to add a cab file/dll to my project to stop this happening?

Thanks

Emmet

View 1 Replies


ADVERTISEMENT

Need Help With ExecuteReader() Command

Jan 18, 2008

HI I am having problem with my Execute Reader. I am trying to insert values from 2 different tables into another table.    SqlCommand comm2; SqlDataReader reader2; /* Grabs the stuff out of the database */
comm2 = new SqlCommand("SELECT HiraganaCharacter,HiraganaImage FROM Hiragana", getConnection()); /* opens the database */
comm2.Connection.Open();
/* starts the reader */
reader2 = comm2.ExecuteReader();
/* goes through the first array list */
for (int i = 0; i < checkedLetters.Count; i++) { /* find the data by using the array list value as a where clause */ comm2.CommandText = "SELECT HiraganaCharacter,HiraganaImage FROM Hiragana WHERE HiraganaCharacter ='"
+ checkedLetters[i] + "'"; /* reads through the data */ reader2.Read(); /* puts the ID- this id was set somewhere else */ CommQuickLinksItems.Parameters["@QuickLinkID"].Value = QuickLinkId; CommQuickLinksItems.Parameters["@CharacterName"].Value = reader2["HiraganaCharacter"].ToString(); CommQuickLinksItems.Parameters["@CharacterImagePath"].Value = reader2["HiraganaImage"].ToString(); CommQuickLinksItems.ExecuteNonQuery(); } for (int j = 0; j < checkedLettersKata.Count; j++) { comm2.CommandText = "SELECT KatakanaCharacter,KatakanaImage FROM Katakana WHERE KatakanaCharacter ='"
+ checkedLettersKata[j] + "'"; reader2.Read(); CommQuickLinksItems.Parameters["@QuickLinkID"].Value = QuickLinkId; /* line it dies on */ CommQuickLinksItems.Parameters["@CharacterName"].Value = reader2["KatakanaCharacter"].ToString(); CommQuickLinksItems.Parameters["@CharacterImagePath"].Value = reader2["KatakanaImage"].ToString(); CommQuickLinksItems.ExecuteNonQuery(); } CommQuickLinksItems.Connection.Dispose(); CommQuickLinksItems.Dispose(); comm2.Connection.Dispose(); comm2.Dispose(); My first question is there a better way to setup a SqlCommand to just get the connection and wait on the Command object text? Right now I am doing comm2 = new SqlCommand("SELECT HiraganaCharacter,HiraganaImage FROM Hiragana", getConnection());Which is kinda pointless since in the for loop I change the command to something different right away. At the same time though I don't really want to make a new SqlCommand object in the for loop since then everytime it goes through the loop it would then re grab the connection what I find pointless tooNow the problem How I have it right now it does not grab the right stuff. The first for loop works great and everything gets inserted. The next loop does not work It seems like it it trying to take the data from the first for loop and insert that stuff again since I get this error System.IndexOutOfRangeException was unhandled by user code Message="KatakanaCharacter" Source="System.Data" StackTrace: at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) at System.Data.SqlClient.SqlDataReader.get_Item(String name) at Practice.QuickLinks() in g:WebsiteJapanesePractice.aspx.cs:line 385 at Practice.btnQuickLink_Click(Object sender, EventArgs e) in g:WebsiteJapanesePractice.aspx.cs:line 411 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException: Basically what I did was for the first loop I chose 2 items and for the 2nd loop I chose 3 items. When it died on this line  CommQuickLinksItems.Parameters["@CharacterName"].Value = reader2["KatakanaCharacter"].ToString();The value was "i" but that was one of the values I choose for the first for loop. It should have been either u,e,o. So I am not sure what I am doing wrong. I thought as long as I change the Command text I would not need to do anything else but it seems like I am missing something.  

View 5 Replies View Related

Using ExecuteReader() And GetString()

Mar 3, 2008

Hi.
I'm trying to read data from a database. This is my code:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
connection.Open();SqlCommand cmd = new SqlCommand(sql, connection);
myReader = cmd.ExecuteReader();if (myReader.Read())
{
name1TextBox.Text = myReader.GetString(1);
addr1TextBox.Text = myReader.GetString(2);
code1TextBox.Text = myReader.GetString(5);
tel1TextBox.Text = myReader.GetString(6);
fax1TextBox.Text = myReader.GetString(7);
:
:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The above code works fine until one of the GetString calls trys to return NULL (in this case myReader.GetString(5)).
In other words, this code will run through about 30 rows of data until it runs in to a NULL entry for one of the columns.
At that stage it's too late. I'm not allowed call GetString( ) on a NULL value.
Is there anyway I can test the column entry before calling GetString( ).
Regards (& thanks in advance)
Garrett

View 4 Replies View Related

Number Of Row Returned By ExecuteReader

Nov 14, 2007

when I execute the line:
reader = comm.ExecuteReader();
Is there a way to get a count of the number of records returned (the query is a SELECT with no count in it)? I want to vary the display of the results set based on the number of records returned.
For example if no records are returned I want it to display nothing, if one, I want the header to be in the singular, but if more than one record is returned, I want it to display the header in plural form.
Here is my code snippet with further explanation of what I am trying to do:int Inumber = 0;foreach (string item in menuHeaders)
{string title = menuHeaders[Inumber];
sp.Value = menuHeaders[Inumber];
Inumber++;
conn.Open();reader = comm.ExecuteReader(CommandBehavior.CloseConnection);
//Get the culture property of the thread.CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
//Create TextInfo object.TextInfo textInfo = cultureInfo.TextInfo;
// WHAT I AM TRYING TO DO....... Here I would like to wrap this with an if statement, if  Records returned by the reader are 0, skip while loop and header display
// If one, then display in singular and if 2 add an s to the title. Convert to title case and display.content.Text += "<H3>" + textInfo.ToTitleCase(title) + "</H3>";while (reader.Read())
{
content.Text += "<a href='" + reader["website"] + "'>" + reader["f_name"] + reader["l_name"] + "</a>"+ ", " +reader["organization"]+"<br />";
}
//Close the connection.
reader.Close();
conn.Close();
}

View 1 Replies View Related

Getting Data From An ExecuteReader Variable

Jan 28, 2008

Hi all,I have a script which I am running to get the minimum date from a database table.I've connected to the database and run the sql but when I try to get the result i get an error saying "No data exists for the row/column."This is the code I have for it at the moment.1 Dim mySql As String = "SELECT MIN(LOSS_DATE) AS minDate FROM dbo_CLAIMS"
2 Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|NexusHolding.mdb;Persist Security Info=True"
3 Dim dbCon As New OleDbConnection(connectionString)4
5 dbCon.Open()6
7 Dim dbComm As New OleDbCommand(mySql, dbCon)8 Dim dbRead = dbComm.ExecuteReader()9 Dim minDate As String = dbRead.GetValue(0)10
11 Response.Write(minDate)Thanks in advance for any help. 

View 3 Replies View Related

Catch Raiserror From ExecuteReader

Feb 27, 2004

Hi. I am executing a stored procedure. The stored procedure raises an error and all I need is to catch this error. Pretty simple, but it only works with an ExecuteNonQuery and not with an Executereader statement. Can anybody explain to me why this happens?

Here's the sp:

CREATE PROCEDURE dbo.rel_test
AS
select 1
raiserror ('My error.', 11, 2)
return
GO

Here's the ASP.Net page:

<% @Page Language="VB" debug="True" %>
<% @Import Namespace="System.Data.SqlClient" %>
<script runat="server">
Public Function RunSP(ByVal strSP As String) As SqlDataReader
Dim o_conn as SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionstring"))
AddHandler o_conn.InfoMessage, New SqlInfoMessageEventHandler(AddressOf OnInfoMessage)

o_conn.Open

Dim cmd As New SqlCommand(strSP, o_conn)
cmd.CommandType = System.Data.CommandType.StoredProcedure
Dim rdr as SqlDataReader = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
rdr.Close()
cmd.Dispose()

Response.Write(o_conn.State)


End Function

Private Sub OnInfoMessage(sender as Object, args as SqlInfoMessageEventArgs)
Dim err As SqlError
For Each err In args.Errors
Response.Write(String.Format("The {0} has received a severity {1}, state {2} error number {3}" & _
"on line {4} of procedure {5} on server {6}:{7}", _
err.Source, err.Class, err.State, err.Number, err.LineNumber, _
err.Procedure, err.Server, err.Message))
Next
End Sub

Sub Page_Load(sender as Object, e as EventArgs)
RunSP("rel_test")
End Sub
</script>

View 2 Replies View Related

Stored Procedure And ExecuteReader

Jul 5, 2005

I am not seeing why this is not executing the reader, it just goes right by it when stepping through the code...
command.CommandType = CommandType.StoredProcedure;
// course
command.Parameters.Add( "@courseId", courseId );
// Parameter: LessonName
SqlParameter sLessonName = command.Parameters.Add( "@lessonName", SqlDbType.VarChar );
sLessonName.Size = 256;
sLessonName.Direction = ParameterDirection.Output;
// error code
SqlParameter pErrCode = command.Parameters.Add( "@errCode", SqlDbType.Int );
pErrCode.Direction = ParameterDirection.Output;
// execute the stored procedure
SqlDataReader spResults;
conn.Open();
spResults = command.ExecuteReader();
while( spResults.Read() ) // It never steps into the while statement like the reader is completed
{
RetrieveObjId objNames = new RetrieveObjId( spResults.GetString( 0 ));
searchResults.Add( objNames );
}
spResults.Close();And the stored procedure is.....CREATE  PROCEDURE dbo.retrieveLessonNames @courseId  VARCHAR(20), @lessonName  VARCHAR(256) OUTPUT, @errCode         INT               OUTPUT  ASBEGIN
 SELECT @lessonName = objName       FROM   objStructure WHERE  courseId = @courseId
 SET @errCode = 0  RETURN @errCode HANDLE_APPERR: SET @errCode = 1  RETURNHANDLE_DBERR: SET @errCode = -1  RETURNENDGOSuggestions?Thanks all,Zath

View 3 Replies View Related

Problems With : SqlDataReader = Command.ExecuteReader()

Apr 11, 2007

I am currently tryinh to have this variable declared :   Dim SQLLecteur As SqlDataReader = Command.ExecuteReader()And receiving the following error : 'ExecuteReader' is not member of 'String'.1. The ExecuteReader was not present in the list following the Command.2. The variable is declared from a : Public Shared Sub3. This sub is located in a code library referenced in the web.config as a namespace : <add namespace="PAX20070409" />4. If used directly in the .vb file within this sub : Protected Sub btnConnection_Click, I am not receiving any errors about the Dim.It is pretty clear why the code is not working, but I have not been able to find a way to fix the problem. I am currently trying to find a way to make the Dim work from within my code library. If you have any idea on how this could be achieve, it would be greatly apreciated.Thank you :)RV3 

View 4 Replies View Related

ExecuteReader: Connection Property Has Not Been Initialized.

Apr 23, 2008

I'm writing my first vb.net app.  Have a default page that uses a persons network login to query a database to get all their  timekeeper id, firstname, last name, etc.  But I keep getting this error.  (My code is below)  What am I missing??? 
ExecuteReader: Connection property has not been initialized.
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.InvalidOperationException: ExecuteReader: Connection property has not been initialized.Source Error:



Line 21: conn.Open()
Line 22:
Line 23: reader = comm.ExecuteReader()
Line 24: If reader.Read() Then
Line 25: EmployeesLabel.Text = reader.Item("tkinit") 
<script runat="server">Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)Dim conn As SqlConnectionDim comm As SqlCommandDim reader As SqlDataReaderDim connectionString As String = ConfigurationManager.ConnectionStrings("xxxConnectionString").ConnectionStringcomm = New SqlCommand("Select top 1 tkinit, tklast, tkfirst +' '+ tklast as fullname from txxx WHERE login = @login)", conn)comm.Parameters.Add("@Login", Data.SqlDbType.VarChar)comm.Parameters("@Login").Value = Me.User.Identity.Name.Substring(User.Identity.Name.IndexOf("") + 1)conn = New SqlConnection(connectionString)conn.Open()reader = comm.ExecuteReader()If reader.Read() ThenEmployeesLabel.Text = reader.Item("tkinit")FirstLastName.Text = reader.Item("fullname")End Ifreader.Close()conn.Close()End Sub</script>

View 1 Replies View Related

ExecuteReader: Connection Property Has Not Been Initialized.

Mar 11, 2005

I have a web form that is generating an error and I can't seem to figure out why for the life of me. Below is the code:


Private Sub VerifyNoDuplicateEmail()
Dim conn As SqlConnection
Dim sql As String
Dim cmd As SqlCommand
Dim id As Guid
sql = "Select UserID from SDCUsers where email='{0}'"
sql = String.Format(sql, txtEmail.Text)
cmd = New SqlCommand(sql, conn)
conn = New SqlConnection(ConfigurationSettings.AppSettings("cnSDCADC.ConnectionString"))
conn.Open()
Try
'The first this we need to do here is query the database and verify
'that no one has registed with this particular e-mail address
id = cmd.ExecuteScalar()
Response.Write(id.ToString & "<BR>")
Catch
Response.Write(sql & "<BR>")
Response.Write("An error has occurred: " & Err.Description)
Finally
If Not id.ToString Is Nothing Then
'The e-mail address is already registered.
Response.Write("Your e-mail address has already been registered with this site.<BR>")
conn.Close()
_NoDuplicates = False
Else
'It's safe to add the user to the database
conn.Close()
_NoDuplicates = True
End If
End Try
End Sub

Web.Config
<appSettings>
<!-- User application and configured property settings go here.-->
<!-- Example: <add key="settingName" value="settingValue"/> -->
<add key="cnSDCADC.ConnectionString" value="workstation id=STEPHEN;packet size=4096;integrated security=SSPI;data source=SDCADC;persist security info=False;initial catalog=sdc" />
</appSettings>


Can anyone show me the error of my ways?

Thanks,
Stephen

View 4 Replies View Related

Command Doesnt Support Executereader

Nov 26, 2006

Code:

connstr = "my connction info"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open connstr

Set objCmd=Server.CreateObject("ADODB.Command")
set objCmd.ActiveConnection = objconn

objCmd.CommandText = "my stored procedure"
objCmd.CommandType = 4

objcmd.parameters.append objcmd.createparameter("@itemcheckduplicate", 200, 1, 30, itemadd)
SqlDataReader forduplicate = objcmd.ExecuteReader()

my procedure :

@itemcheckduplicate varchar(30)

as
select sw_item_itemid
from sw_item
where sw_item_item like @itemcheckduplicate



why my command doesnt support ExecuteReader ?

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'ExecuteReader'

View 2 Replies View Related

ExecuteReader: CommandText Propert Has Not Been Initialized

Oct 2, 2007



Hello All,

I receive the following error when attempting to preview or run a simple report:

ExecuteReader: CommandText propert has not been initialized


I have searched the help website and other forums, but I have had no success.

I am new to Reporting Services and this is one of the first reports I have created. All of my reports have this error.

Any ideas?

Thanks in advance.

View 1 Replies View Related

ExecuteReader Error A Parameter Is Missing [Paremeter Ordinal = 1]

Sep 24, 2007

Hello and thanks in advance.

This error was received executing a SqlCeCommand method of ExecuteReader();

I have only found 3 hits in Google about this error and the time it was asked in a MS forum it was not answered. I need an answer, please.

bombar...see code below


SqlCeDataAdapter adp = null;

adp = new SqlCeDataAdapter();

SqlCeCommand cmd;

cmd = _Con.CreateCommand();

cmd.CommandType = CommandType.Text;

cmd.CommandText = "insert into InventoryCounts(DateTime,WarehouseID,PartID,LotID,UserName,Count) VALUES(?,?,?,?,?,?)";

adp.InsertCommand = cmd;

cmd = _Con.CreateCommand();

cmd.Parameters.Clear();

SqlCeParameter p1 = cmd.Parameters.Add("DateTime",SqlDbType.DateTime);

SqlCeParameter p2 = cmd.Parameters.Add("WarehouseID",SqlDbType.NChar,20);

SqlCeParameter p3 = cmd.Parameters.Add("PartID", SqlDbType.NChar,20);

SqlCeParameter p4 = cmd.Parameters.Add("LotID", SqlDbType.NChar,20);

SqlCeParameter p5 = cmd.Parameters.Add("UserName", SqlDbType.NChar,20);

SqlCeParameter p6 = cmd.Parameters.Add("Count", SqlDbType.Int);

p1.Value = Convert.ToString(DateTime.Now);

p2.Value = "Warehouse1";

p3.Value = txtBPartIDShow.Text;

p4.Value = txtBLotIDEntry.Text;

p5.Value = "JHB";

p6.Value = Convert.ToInt32(txtBCountEntry.Text);



cmd = _Con.CreateCommand();

cmd.CommandType = CommandType.Text;

cmd.CommandText = "insert into InventoryCounts(DateTime,WarehouseID,PartID,LotID,UserName,Count) VALUES(?,?,?,?,?,?)";

cmd.Prepare();

cmd.ExecuteReader();

View 4 Replies View Related

System.InvalidOperationException: ExecuteReader: Connection Property Has Not Been Initialized.

Jan 29, 2008

Hi,

I have written a CLR Function in C#. The function works as expected except that I am trying to read data some data during the function call and get the following error:


Msg 6522, Level 16, State 1, Line 1

A .NET Framework error occurred during execution of user-defined routine or aggregate "fn_SLARemaining":

System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.

System.InvalidOperationException:

at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, 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 SLARemaining.SupportTimes.addSupportHours()

at SLARemaining.CalculateTimeRemaining.GetTimeRemaining(String openDate, Decimal SLADuration)

at UserDefinedFunctions.fn_SLARemaining(SqlDateTime DateFrom, SqlDateTime DateTo, SqlInt32 PriorityTime, SqlDecimal AdjustmentTime, SqlDecimal Status)

.


The main code for the function is this:


using System;

using System.Data;

using System.Data.SqlTypes;

using System.Data.SqlClient;

using Microsoft.SqlServer.Server;

public partial class UserDefinedFunctions

{

[Microsoft.SqlServer.Server.SqlFunction(DataAccess = DataAccessKind.Read)]

public static SqlString fn_SLARemaining(SqlDateTime @DateFrom, SqlDateTime @DateTo, SqlInt32 @PriorityTime, SqlDecimal @AdjustmentTime, SqlDecimal @Status)

{

SLARemaining.CalculateTimeRemaining remaining;

remaining = new SLARemaining.CalculateTimeRemaining();

int duration = Convert.ToInt32(PriorityTime.ToString());

if (!DateFrom.IsNull)

{

string date = DateFrom.Value.ToShortDateString() + " " + DateFrom.Value.ToShortTimeString();

SqlString result = remaining.GetTimeRemaining(date, duration);

return result;

}

else

{

return null;

}

}

};


The function calls the following method from another class:


public string[] addSupportHours()

{

string[] supportedHours = new string[28];

SqlDataReader dr;



SqlCommand cmd = new SqlCommand();

cmd.CommandText = "xxxxxxx"; //<-- commented out for this post

using (SqlConnection cn = new SqlConnection("context connection=true;"))

{

cn.Open();


dr = cmd.ExecuteReader();



while (dr.Read())

{
//do some stuff
}

cn.Close();

cn.Dispose();
}

The error message claims that the connection has not been initialized - can't work out why? Any help will be appreciated!

View 3 Replies View Related

Intermittent Locks

Nov 23, 2004

We are experiencing problems intermittently.

Users report problems of various types including timeout messages. We investigate and find a user has acquired a lock which is blocking other users.

We contact the user and they have usually completed their activity and are not always aware of any problem despite them owning a lock.

When the user logs out of the application the lock clears and the system returns to normal.

Indexes have been rebuilt, auto update statistics is on.

Does anyone have any suggestions? :cool:

View 3 Replies View Related

Intermittent OLE DB Error

Jan 29, 2007

I have this problem occuring intermittently:When I try to add a package to the project, and click on the Packagepath button. I get a oledb error x080004005 (client unable toestablish connection)...After I click ok, and click on the Package path again 2 or 3 times,the error goes away and I get the list of packages displayed. Sometime I get an empty list box.Similar to this happens when I execute a package also. When I executeit 2nd or 3 rd time it works fine. The error happens only when I amtrying to connect to the serverdatabase. Once it is in the databaseI do not get any error message.This is what I have:I have sql 2005 installed.Microsoft SQL Server ManagementStudio9.00.1399.00Microsoft Analysis Services ClientTools2005.090.1399.00Microsoft Data Access Components(MDAC)2000.085.1117.00 (xpsp_sp2_rtm.040803-2158)Thank you in advance!!!

View 2 Replies View Related

Intermittent Ole Db Error

Jan 25, 2007

I have this problem occuring intermittently:


When I try to add a package to the project, and click on the Package path button. I get a oledb error x080004005 (client unable to establish connection)...



After I click ok, and click on the Package path again 2 or 3 times, the error goes away and I get the list of packages displayed. Some time I get an empty list box.

Similar to this happens when I execute a package also. When I execute it 2nd or 3 rd time it works fine. The error happens only when I am trying to connect to the serverdatabase. Once it is in the database I do not get any error message.



This is what I have:

I have sql 2005 installed.
Microsoft SQL Server Management Studio 9.00.1399.00
Microsoft Analysis Services Client Tools 2005.090.1399.00
Microsoft Data Access Components (MDAC) 2000.085.1117.00 (xpsp_sp2_rtm.040803-2158)



Thank you in advance!!!



View 6 Replies View Related

3201 Intermittent Errors On LS

Aug 26, 2003

I have log shipping setup to 2 different servers. Every once in a while I get the

Server: Msg 3201, Level 16, State 1, Line 1 Cannot open backup device 'E:fac.dat'. Device error or device off-line. See the SQL Server error log for more details. Server: Msg 3013, Level 16, State 1, Line 1 Backup or restore operation terminating abnormally.

Checked MSDN which said it was a permissions error, which isn't right, because the same account works for this db and several others all the time. Anyone else seen this?

View 1 Replies View Related

Intermittent Restart Of SQL Server 6.5

Apr 3, 2001

I've a SQL server that intermittently restarts itself mostly during. Its a SQL Server 6.5 SP4 running NT 4.0 SP6. It really has no rhyme or reason to it happening. The are no indications in either the SQL or the Nt events logs.
Has anyone heard of this?

Thanks inadvance

View 2 Replies View Related

Intermittent Time Out Errors

Feb 5, 2008

We recently migrated a SQL 2000 DB to SQL Server 2005 SP2. We have a VB 6 executable that uses the SQL Server 2005 DB. Immediately we began getting intermittent errors when trying to run a Stored Proc on SQL 2005 DB. The two errors we see are:

Timeout expired

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

If you immediately try to run the same query, it usually will work. The queries are random and so are the errors. I have gotten the time out error in Server Management Studio a couple of times.

In the VB 6 App we are using MDAC 2.81. Her is the connection string:
Provider=SQLOLEDB.1;User ID=user;password=password;Initial Catalog=OASIS;Data Source=servername, portnumber

We added the port number to the DataSource in an attempt to troublshoot the issue, but it made no difference.

We have run sysinternals Process Monitor on a PC with the app running and we saw NAME NOT FOUND Results for Query Open actions for these DLLS:
C:Program FilesOASISCLUSAPI.DLL
C:Program FilesOASISRESUTILS.DLL
C:Program FilesOASIStdsapi.dll

C:Program FilesOASIS is the application path. Of course, they are not in the application path but they are in C:WindowsSystem32. They do not seem to be registered.

Here is an example of the code we use in a class to run a SP:

Public Function FetchPostings() As ADODB.Recordset
Dim cmFetch As ADODB.Command

On Error GoTo HandleError
Set cmFetch = New ADODB.Command
With cmFetch
.Name = "FetchObligations"
.ActiveConnection = gobjSecurity.Connection 'This is a connection string not a connection object
.CommandText = "spClaimFetchObligations"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("ClaimID", adInteger, adParamInput, , mlngClaimID)
Set FetchObligations = .Execute
End With

ExitSub:
Set cmFetch = Nothing
Exit Function

HandleError:
gobjError.HandleError Err.Number, Err.Description, App.EXEName, "clsClaim", "FetchObligations", gobjSecurity.UserID
Resume ExitSub
End Function


View 1 Replies View Related

Intermittent FTP Task Error

Nov 17, 2007

Hello,

Once in a while we receive this error from a script task in an SSIS package that runs from a scheduled job:

Unable to receive files using "FTPConnMngr".

A search on google yielded nothing. Has anyone encountered this error, and/or what are some possible causes?

Thank you

View 3 Replies View Related

Intermittent Field Display

Mar 7, 2007

This is either a bug, or I am crazy.

I have developed a report that pulls its data from an SSAS cube. The report is grouped on Fields!FacilityName. On each "page" of the report, I have information for the displayed facility.

At the top of each page in my report I have a textbox whose value is =Fields!FacilityName. Further down on the report I have another text box whose value is set exactly the same. When I preview the report, I always have a value in the upper box, but only sometimes have a value in the lower box. If I change the value in the lower box to just a text string, it will always display, but when I put in the actual field reference it does not. It always doesn't display for the same facility names. Remember, the upper textbox on the form always displays 100% of the time.

I have a Dundas chart in the middle of the page on the report between these textboxes, but another field that pulls parameters and even a matrix all render correctly below that chart.

They both have the same parent according to the properties. I have even copied and pasted the working textbox further down the screen, with no improvement. When I changed the value of the textbox to "=cstr(len(Fields!FacilityName))", on the pages when it wants to be blank, it reads 0, and on other pages it shows a larger number. But the other textbox on the screen will always properly show the FacilityName.

I have also tried changing the name of the textbox, settings output to YES instead of Auto. If I slide the non-working textbox up to the top of the page and the working textbox down to the bottom area of the page, the bevavior switches.

Does anybody know of rendering issues with textboxes showing the same infomation?

View 4 Replies View Related

Intermittent Failures Using Web Synchronisation

Dec 18, 2005

HI

We are using HTTPS anonymous merge subscriptions....

Sometimes when trying to synchonise, we will get the following error messages returned to the subscriber....

The upload message to be sent to Publisher '**thewebserver**' is being generated
The merge process is using Exchange ID '0F65CFCB-AF17-47DC-8D98-493A44C243E0' for this web synchronization session.
The Merge Agent could not connect to the URL 'https://**thewebserver**/client/replisapi.dll' during Web synchronization. Please verify that the URL, Internet login credentials and proxy server settings are correct and that the Web server is reachable.
The Merge Agent could not connect to the URL 'https://**thewebserver**/client/replisapi.dll' during Web synchronization. Please verify that the URL, Internet login credentials and proxy server settings are correct and that the Web server is reachable.
The Merge Agent received the following error status and message from the Internet Information Services (IIS) server during Web synchronization: [401 :'Unauthorized']. When troubleshooting, ensure that the Web synchronization settings for the subscription are correct, and increase the internet timeout setting at the Subscriber and the connection timeout at the Web server.


If I then go to a web brower, put in the HTTPS address, it brings up the logon dialog - I put in the admin username and password to confirm the connection and that's fine.

We try and synchronise again, and this time it works - it's as though I have 'woken' it up again and it's happy to play.

Is increasing the timeouts as suggested by the error message the way to go ? If so, where does one set the 'internet timeout setting at the subscriber', and the 'connection timeout at the webserver' ?

 

thanks

 

 

View 3 Replies View Related

Intermittent Replication Issue

Aug 13, 2006

Hello,

I currently run a nightly replication from a windows server 2003 machine with sql server 2000 sp3 to a windows 2003 server machine with sql server 2005 sp1. I run a snapshot replication as merge is not supported from 2000 to 2005.

2 out 5 snapshots weekly fail with the following error:

2006-08-09 17:00:06.97 Message Code: 10054
2006-08-09 17:00:06.97
2006-08-09 17:00:06.97 [0%] The replication agent had encountered an exception.
2006-08-09 17:00:06.97 Source: Replication
2006-08-09 17:00:06.97 Exception Type: Microsoft.SqlServer.Replication.ConnectionFailureException
2006-08-09 17:00:06.97 Exception Message: TCP Provider: An existing connection was forcibly closed by the remote host.

I have setup the sql server 2005 agent service to automatic with a 'log on as' domain admin account. The sql server agent on the 2000 machine uses the local system account.

Does anyone know what i can try to fix this?

thks

geoff







View 3 Replies View Related

Intermittent Connection Timeouts

Apr 6, 2007

I'm having an issue with what appears to be SQL Server 2005 deciding to randomly ignore new connections.



I currently have two virtual servers - one running just SQL Server 2005, the other running Reporting Services, Windows Sharepoint Services and Team Foundation Server.



For 3 weeks, it was all working perfectly, then on Wednesday night the server (and both Virtual Servers) was rebooted after installing the latest updates for Windows. Since then, I've had this issue.



It will work fine for a while, then it'll start throwing loads of Errors and Warnings into the Event Log, all along the lines of unable to connect to the database. The Reporting Services Configuration utility throws up the same problem. Then randomly, it'll start working again.



If anyone has any ideas, they would be much appreciated as this is driving me crazy!



Thanks!

View 2 Replies View Related

Ways To Determine Intermittent Slowdowns

Oct 3, 2005

For some reason my SQL Server slows down throughout the day for no apparent reason..

The database is 100 gig transaction replicated to 2 data warehouses.

Ive done the usual stuff like monitoring processes killing off blocking transactions but it doesn't seem to do the trick.

There are no jobs running at the point of slow-down so at this current time I am a little lost.

Is there some way to determine why these slow-downs are happening ?

The system becomes completely un-responsive during these periods !!
HELP !! :eek:

View 4 Replies View Related

Multiple DB Versions / Intermittent Connection

Apr 11, 2012

I'm working on a DB that will be used in separate physical locations. These DBs will be identical in structure and completely independent of each other. Whilst some tables will retain similar or identical information, there is a large amount of content that will diverge.However, there is a central location that will need to manage these DBs. There will be a requirement from this central location to run reports, often comparing data between them, and to push data into each child location. There is no requirement for the child locations to 'share' information and indeed the volume concerned and the intermittent/low-bandwidth nature of their connections would make this undesirable. If an individual selection of data does need to be shared between I'm happy for it to be uploaded centrally, a decision made, and manually pushed to each child-location.

Which brings me to my real question. Should I try and include composite Primary Keys in many of the tables (to include probably an incrementing number and another field of site ID) so that when I absorb them all back centrally I can put them into one large DB. Or should I keep them as separate DBs in the central location and use some fairly 'normal' mechanisms for mirroring to sites; accepting that this will make running comparisons between them more difficult and potentially more difficult to write interactivity for centrally?

The best 'real world' comparison I can think of is transactions in retail shops. How do these transaction logs get stored centrally when they're all generating individual transaction numbers that are only unique in that location?

View 1 Replies View Related

Intermittent Slow SQL2005 Database

Aug 2, 2007

I'm querying a small SQL2005 database and finding that the query can sometimes complete in under a second and then 5 minutes later the same query can take 15 minutes to complete.

The query I'm running is very simple as follows:
select TOP 26 * from vSearchListOpportunityItem WHERE OpIt_OpportunityId=2495 ORDER BY Prod_Name, OpIt_OpportunityItemId

The view it is pulling data from only contains only 1890 lines, which in turn pulls data from 3 tables with 821, 2560, and 1957 lines of data. In other words it's small. I have noticed that if I try and open the smallest of these tables while on a 'go slow' period it also takes around 15 minutes to return the data.

The database was originally on SQL 2000. It is the only database on this powerful quad core server.
The SQL Server CPU usage never goes above 40%, and always has free memory.
No sign of locks.

I can't figure out why such a small database is going so slow with such a simple query. Any ideas?

View 8 Replies View Related

SQLExpress Intermittent Login Errors

May 18, 2006

This is very strange...

After installing the Advanced Services package, I started getting errors connecting to a database (.MDF) that I've been using for weeks/months.

The error was something like "login failed for machineuser". After twiddling with the connection string and starting and stopping the SQLEXPRESS service it started working again. Did some more work, everything was fine, shutdown and went to bed.

This morning, I am unable to connect to the database - nor any other database, it seems. This time I'm getting "cannot find the physical file" type errors.

Any leads on solving this would be much appreciated. I've search using the error codes and I'm not turning anything up that seems quite like the problem I'm having.

- porko

View 7 Replies View Related

Intermittent Access To SQL Server 2005

Jun 14, 2007

I'm having weird issues with connecting to MS SQL Server. Sometimes it can establish a connection and sometimes it can't. This is both with ODBC and with .net code. This happens on multiple computers. I.e. one minute you can connect, the next you can't.



I have a SQL 2000 server which connects fine every time. So I assume the problem is with the upgraded MS SQL Server. I want to be able to resolve this issue before upgrading the main server to SQL 2005.

View 3 Replies View Related

Intermittent Failure Of Interdatabase Service With SP-1 CTP

Apr 5, 2006

In an SSB test project created from the T-SQL batch in Stuart Padley's Weblog (subtitled "SQL Server 2005 stuff I couldn't find anywhere else", http://blogs.msdn.com/stuartpa/archive/2005/07/25/443229.aspx) I found strange inconsistencies with enquing messages between two databases on the same SQL Server 2005 Standard Edition SP-1 CTP March instance running under Windows Server 2003 SE SP-1:

Sending a simple message from the Initiator to the Target database with either the SendMessageProc stored procedure or its code as a batch fails for about 50% of all tries, with varying failure patters (up to 10 sequential attempts fail). Messages for failed tries remained in the transmission_queue, but didn't appear in the InitiatorQueue or TargetQueue.

I made the following changes to Stuart's code in the SendMessageProc procedure and my SendInitiatorToTarget.sql messaging script:

1. Split out EXEC SendMessageProc from Stage 4 and all of Stage 5 into a separate batch to enable sending multiple messages without recreating all objects.
2. Changed BEGIN DIALOG to BEGIN DIALOG CONVERSATION
3. Added a missing END CONVERSATION statement

A simple intradatabase service based on the "Hello World" DB Engine sample run in the Northwind or AdventureWorks database behaves as expected.

The partition with SQLS 2005 SP-1 also has SSX SP-1 with Advanced Services installed. Some minor problems occured when installing SSX SP-1, so I removed the original SSX instance and reinstalled SSX SP-1. See http://oakleafblog.blogspot.com/2006/03/sql-server-2005-sp1-ctp-available-for.html.

The same SSMS project runs fine on a fresh install of SQLS 2005 RTM under WS 2003 SP-1 on another machine partition. (This machine isn't running VS.) No messages fail to reach the Target database, as would be expected.

Has anyone else encountered similar anomalous behavior with SSB under SP-1 CTP? This problem ran me nuts for an entire day until I finally gave up and created a new SQLS 2005 RTM test instance.

If anyone (especially Remus) wants a copy of the scrpt, send your e-mail address to roger_jennings(nospam_at)compuserve(nospam_dot)com.

--rj

View 7 Replies View Related

SSMS - Intermittent Login Failure

Mar 31, 2006

I have a 2000 / 2005 side-by-side installation on our test server.

To login to 2005 with SSMS, the connect string is

hostname/SQL2005, 1434

There's a WiFi network connecting my client PC to the network.

SSMS fails to login frequently. I need to exit SSMS, then login again. It'll work.

A new problem today - after successful login, I can't open a project and login successfully. Error messages states "Failed to Login".

Any tips?

Sam

View 1 Replies View Related

Intermittent Connection Problems With Sql Server

Jan 12, 2007

I am experiencing intermittent connection problems with the Northwind database and sql server express. The most frequent error message indicates that I am already logged in and will not allow another user.

The odd thing is that even when I am locked out I can access a Northwind database from another connection on Server Explorer.

I ran code to demonstrate simple binding for two text boxes, no problem. I added a project to show complex binding using the datagrid view tool, but could not get past selecting the database.

I tried the same simple binding project on another computer running a beta version of VS 2005 Pro and could not connect to Northwind on that computer also. (Two different Northwind databases, different computers)

A couple days ago I restored the database in Solutions Manager and that helped for a while, but I should not have to resort to that, I know.

How do I remove the user lock? I tried Solutions Manager Express with the first computer but could not access the database in the management module.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved