MARS
Jun 18, 2008What's the benefit of Multiple Active Result Sets? When would you use it. Read the BOL article but still not quite sure what its use is. there doesn't seem to be a performance gain. So what's the purpose?
View 5 RepliesWhat's the benefit of Multiple Active Result Sets? When would you use it. Read the BOL article but still not quite sure what its use is. there doesn't seem to be a performance gain. So what's the purpose?
View 5 RepliesWe have had a SQL server 2005 database up and running for some time and now we are getting this error:
[The server will drop the connection, because the client driver has sent multiple requests while the session is in single-user mode. This error occurs when a client sends a request to reset the connection while there are batches still running in the session, or when the client sends a request while the session is resetting a connection. Please contact the client driver vendor.]
We use MARS in our Windows Application (.NET 2.0) and can not seem to figure out what is going on...
After this error shows up in the event viewer, we get a second error (milliseconds later) in our application. "A severe error occurred on the current command. The results, if any, should be discarded."
i really need help on this one... it seems it is not with our SP but the connection to SQL Server 2005 Express and using MARS... i double checked the connection string and it is all setup correctly and we are in Multi-User Mode.
PLEASE HELP!
ward0093
Does the Compact edition support the MARS feature (multiple active result sets) of SQL Server 2005?
View 3 Replies View RelatedI am trying to make a connection to an SQL database held on myserver I am able to connect through a machine data source using access using the credentials as below the attempt fails at con.open with following error:
System.Runtime.InteropServices.COMException was caught
ErrorCode=-2147467259
Message="Named Pipes Provider: Could not open a connection to SQL Server [53]. "
Source="Microsoft SQL Native Client"
StackTrace:
at ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options)
at Client_Access.JobRequest.AddJob_Click(Object sender, EventArgs e) in C:Documents and SettingsRobertMy DocumentsVisual Studio 2005Projects Client Access Client AccessJobRequest.vb:line 392
Dim con As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sPassword As String, sUserID As String
sPassword = "abcde"
sUserID = "cClient"
Try
con.ConnectionString = "Provider=SQLNCLI;" _
& "Server=(myserver);" _
& "Database=transportRecs;" _
& "Integrated Security=SSPI;" _
& "DataTypeCompatibility=80;" _
& "UID=" & sUserID & ";" _
& "PWD=" & sPassword & ";" _
& "MARS Connection=True;"
Dim mySQL As String
mySQL = "SELECT * FROM dbo_jobitem " '& _
'" WHERE [Custid] ='" & strTag & "'"
con.Open()
rst = New ADODB.Recordset
With rst
.ActiveConnection = con
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.CursorType = ADODB.CursorTypeEnum.adOpenStatic
.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic
.Open(mySQL)
.MoveLast()
.MoveFirst()
.MoveLast()
.MoveFirst()
Debug.Print(.RecordCount)
End With
Catch ex As Exception
MsgBox(ex.ToString)
Finally
If (con.State = ConnectionState.Open) Then con.Close()
End Try
Can anyone help.
Regards,
Joe
I have a DAL that uses Typed DataSets (not directly, the DAL references and calls the dataset methods) and I am receiving a "There is already an open DataReader associated with this Command which must be closed first." error when I render an ASP.NET page where two imgs need to retrieve two different versions of an image (a thumbnail and a full sized image).I am using SQL Server 2005, ASP.NET 2.0, and my connection string includes the MARS attribute set to true. This is the method in the SqlServer DAL, _images is a typed table adapter:public override Image SelectImage(Guid? id) { // TODO: Find out why MARS feature isn't working! DataSet.ImageDataTable dt = _images.SelectImageById(id); <-- Exception occurs here if ((dt != null) && dt.Count == 1) { DataSet.ImageRow row = dt[0]; Guid? keyId = null; if (!row.IsKeyIdNull()) { keyId = row.KeyId; } // Success return new Image(row.Id, keyId, row.Path, row.Caption); } return null; } // This is the method that is called for both images, which calls the DALpublic class EntitySearch{ public static Image ImageById(Guid id) { return _dal.SelectImage(id); }}// These are the code-behind methods that the image response strings will come from...imgThumbnail.ImageUrl = String.Format("../Services/ImageBroker.aspx?img={0}&mode=Thumbnail", image.Id);imgFullImage.ImageUrl = String.Format("../Services/ImageBroker.aspx?img={0}&mode=Image", image.Id); // And finally here is the code in the broker class that saves the images to the response streamImage image = EntitySearch.ImageById(imageId);using (Picture picture = (mode == ImageMode.Image) ? image.Picture : image.Thumbnail){ Picture.Save(response.OutputStream, ImageFormat.Jpeg);}So the final snippet of code is being called twice, and it crashes. I have tried closing the connection and reopening it as a workaround but this only yields strange results, though it intermittently does load the images.Can anyone spot the issue?
View 1 Replies View Related