Transaction & Disconnected Mode

Jan 2, 2010

disconnected mode and transaction.it's give to me ERROR message

Quote.ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized
PHP Code:
da.InsertCommand = cb.GetInsertCommand

my code is:

PHP Code:
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("DBCon").ConnectionString)
Dim cmd As New SqlCommand("insert into Customer (customer_id, customer_name, note) values (@cid, @cname, @note)", con)
Dim da As New SqlDataAdapter("select * from CustomerPhone", con)

| [code]....

View 7 Replies


Similar Messages:

Flush Separate Castle ActiveRecord Transaction And Refresh Object In Another Transaction

Jun 15, 2010

I've got all of my ASP.NET requests wrapped in a Session and a Transaction that gets commited only at the very end of the request. At some point during execution of the request, I would like to insert an object and make it visible to other potential threads - i.e. split the insertion into a new transaction, commit that transaction, and move on. The reason is that the request in question hits an API that then chain hits another one of my pages (near-synchronously) to let me know that it processed, and thus double submits a transaction record, because the original request had not yet finished, and thus not committed the transaction record.

So I've tried wrapping the insertion code with a new SessionScope, TransactionScope(TransactionMode.New), combination of both, flushing everything manually, etc. However, when I call Refresh on the object I'm still getting the old object state. Here's some code sample for what I'm seeing:

Post outsidePost = Post.Find(id); // status of this post is Status.Old
using (TransactionScope transaction = new TransactionScope(TransactionMode.New))
{
Post p = Post.Find(id);
p.Status = Status.New; // new status set here
p.Update();
SessionScope.Current.Flush();
transaction.Flush();
transaction.VoteCommit();
}
outsidePost.Refresh();
// refresh doesn't get the new status, status is still Status.Old

View 1 Replies

Web Forms :: The Client Disconnected?

Jun 27, 2010

The client disconnected.File Name: {0}Method Name: {0} Application_Error Error Line Number: {0} Error Column Number: {0}

[code]...

View 2 Replies

C# - .NET Remoting - How To Handle Disconnected Objects

Oct 26, 2010

First, let me explain a little bit about my setup. My server is setup as a Marshaled singleton object:

RemotingServices.Marshal(lsServer, ServerObject.objectUri);

In order to have two-way communication from the server to the client, the client activates a ServerObject, then passes in its own ClientObject (which is also a MarshalByRefObject) the server uses the ClientObject to talk back to the client:

var lsClient = new ClientObject();
var lsServer = (ServerObject)Activator.GetObject(typeof(ServerObject), url);
lsServer.attach(lsClient);

When the attach method is called, the server takes the ClientObject and stores it in a List:

public void attach(ClientObject client) {
clientList.Add(client);
}

The server can then call a method on the ClientObject called "SendMessage" to communicate to each client in its list:

foreach(var c in clientList) {
c.SendMessage("Hello");
}

This works great until a client is encountered that has disconnected. In this case, an error is thrown about the client refusing the connection. I can catch the error, but the problem is I cannot remove the reference to the ClientObject from the server's List. The following re-throws the "connection refused" exception anytime a client has been disconnected:

clientList.Remove(badClient);

So a couple of questions:

1- Is there a way to detect the connection state of a client without having to catch an error?

2- When I do detect a client that has disconnected, why does the attempt to remove the object from the server's list appear to "communicate" with the client (thus causing the exception to be thrown again?)

EDIT

As Patrick pointed out below, doing a Remove from a list causes the List to iterate my objects and do a comparison on them (calling .Equals) - this is what caused my ClientObject to attempt to communicate again and thus throw the exception. To resolve it, I instead changed the List to a dictionary keyed off a unique ID supplied by my Client at the time of attaching to the server. Then I used that unique ID to remove the client. I never did find a direct way for determining if a client had disconnected other than catching the error.

View 1 Replies

The DataSet Is A Disconnected Data Object?

Mar 10, 2011

The DataSet is a disconnected data object. Once the DataSet has been filled, the connection can be closed and the DataSet's contents can still be examined and manipulated.What does manipulated mean ? If possible, then please give me example(s) for manipulated.

View 5 Replies

How To Show Default Content To End User When Interent Is Disconnected

May 29, 2010

I have designed program to display live events/content(like online orders in shop) at different location. Now case is, suppose Some of Clients putting order for material and suddenly Internet gets disconnect.So what I am looking for, in this case, I want to show some default text/images to End user who is trying to put orders. I am ready to design to Desktop Application to do this, but I need inputs on how to achieve this at User end?

View 5 Replies

AJAX :: Comet - Detect If The Client Disconnected During Those 10 Minutes?

Jan 29, 2010

I implemented a chat using the COMET "way" described in this article: http://www.codeproject.com/KB/aspnet/CometAsync.aspx

In this example, the client connects for 5 seconds every time. I wanted to hold the client longer, for about 10 minutes.

My problem is - how to detect if the client disconnected during those 10 minutes? I tried using Response.IsClientConnected but it returns true even if I close the client. There must by some inidicator since the socket gets disconnected if I close the client.

View 2 Replies

Entity Framework. Updating EntityCollection Using Disconnected Objects Via Navigation Property?

Apr 22, 2010

I have a question, much liket this unanswered one. I'm trying to work with the entity framework, and having a tough time getting my foreign tables to update. I have something basically like this in the DB:

Incident (table):

-ID
-other fields

Responses (table):

-FK:Incident.ID
-other fields

And and entities that match:

Incident (entity)
-ID
-Other fields
-Responses (EntityCollection of Responses via navigation property)

Each Incident can have 0 or more responses.

In my Webpage, I have a form to allow the user to enter all the details of an Incident, including a list of responses. I can add everything to the database when a new Incident is created, however I'm having difficulty with editing the Incident.

When the page loads for edit, I populate the form and then store the responses in the viewstate. When the user changes the list of responses (adds one, deletes one or edits one). I store this back into the viewstate. Then when the user clicks the save button, I'd like to save the changes to the Incident and the Responses back to the DB. I cannot figure out how to get the responses from the detached viewstate into the Incident object so that they can be updated together.

Currently when the user clicks save, I'm getting the Incident to edit from the db, making changes to the Incident's fields and then saving it back to the DB. However I can't figure out how to have the detached list of responses from the viewstate attach to the Incident. I have tried the following without success:

Clearning the Incident.Responses collection and adding the ones from the viewstate back in:

Incident.Responses.Clear()
for each objResponse in Viewstate("Responses")
Incident.Responses.add(objResponse)
next
Creating an EntityCollection from my list and then assiging that to the Incident.Responses
Incident.Responses = EntityCollectionFromViewstateList
Iterating through the responses in Incident.Response and assigning the corresponding object from viewstate:
for each ObjResponse in Incident.Responses
objResponse = objCorrespondingModifedResonseFromViewState
Next

These all fail, I'd like to be able to merge the changes into the Inicdent object so that when the BLL calls SaveChanges on the changes to both the Incident and Responses will happen at the same time.

View 1 Replies

C# - In Visual Studio 2005 Build Mode Drop Down, Release Mode Not Shown

Sep 15, 2010

I got a project when after opening in visual studio 2005 in build mode drop down, only debug mode is shown but release mode not shown.Project builds successfully in debug mode is there a way to enable release mode.

View 1 Replies

Forms Data Controls :: Necessary To Add Mode Changing And Mode Changed In The Back Code

Mar 7, 2011

gaining mode changing for formview in VB.The problem is that, the current mode im using was ReadOnly, and i want to add some button so thatit could connect to Edit mode in the same formview.Is it necessary to add modechanging and modechanged in the back code?

View 2 Replies

C# - What Is The Difference Between Debug Mode And Release Mode In Visual Studio 2010

Mar 17, 2011

Possible Duplicates: Debug/Release difference Performance differences between debug and release builds

What exactly is the different in compiling and running an asp.net/c# project in Debug mode VS Release Mode?

View 3 Replies

SQL Server :: How To Connect Database In Sql Authentication Mode Rather Than Windows Mode

Oct 16, 2010

I wanted my local iis running application to connect my database in sql authentication mode rather than windows mode,

but it is showing errors of " Cannot open database "aspnetdb" requested by the login. The login failed.
Login failed for user 'DBUser'. ". i also ublocked port from firewall,and allowed remote connection of mssql from sql manager, enabled TCP/IP and named piped protocols from SQL surface config, and with sql manager i also changed server authentication mode to sql from windows.
my datastring is <add connectionString="Data Source=PARTHIV-PCSQLEXPRESS;Initial Catalog=aspnetdb;User ID=******;Password=******/" name="LocalSqlServer" providerName="System.Data.SqlClient" />

i made a user named DBUser in database as well i don't understand where it gone wrong ???

here is error log

[Code]....

View 4 Replies

'run Mode' Variable / Running Web Project In Debug Mode Or Compiled?

Aug 7, 2010

can i determine programmatically if im running my web project in debug mode or compiled?

or even better if im running it on my local machine or on a server? example to change the path for databases etc..

View 7 Replies

Error Handling "Client Disconnected"

Jul 30, 2010

I need to filter the "Client Disconnected" error below in my global.asax file. Does anyone know what kind of exception it is so that if it matches i can do extra processing?
---------------------------------------------

Message: The client disconnected.

Source: System.Web

Method: Void ThrowError(System.Exception, System.String, System.String, Boolean)

Stack Trace:at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
[code]....

View 1 Replies

Site Can Publish In Release Mode Or Debug Mode

Sep 7, 2010

how can i tell the diffence between a website that has been published in release mode and the same website that was published in debug mode

View 4 Replies

SQL Server In Debug Mode And MySQL In Release Mode?

Jan 7, 2011

is there a way to use sql server to debug locally and mysql onthe remote published version ? perhaps with web.config and AppSettings ?

View 3 Replies

System Can Support Both Standard Mode And Quirks Mode?

Jan 4, 2011

I was assigned a bug saying that some page elements don't work on IE8 Quirks mode at all, and I need to fix them. The point is that I believe our pages will always be rendered in Standard mode, because we specify DOCTYPE at the beginning of every page (via master page). I'd think it must be some debugging tools changed that during testing.I managed to convice QA to close it as by design, after a brief explanation to her. Now I start to think the question that whether we should have our page work on both Standard and Quirks mode.

View 2 Replies

FormView From Insert Mode To ReadOnly Mode

Feb 23, 2011

have a WebForm with a Form View to insert new items in my database.These items that i will insert also are conected to other many-to-many relations that i also wanna add after my new item is inserted.For Example: With the classic Autors-Books data base (autors with many books each books with many autors), i want a FormView that for defoult enter to the InsertMode where you will add a new Autor with name, age, style, etc... After you insert this new autor i wanna show the details of this autor but also his books (when new this table will be empty) and below that table i want a button that says "Add a new book to this autor"

View 1 Replies

ADO.NET :: How To Check SQL Transaction Log

Jan 7, 2011

We can catch the error log information by use EXEC xp_readerrorlog. I am just wondering is SQL have other types of log for us to reference information

I didn't wrote trigger for my tables... one table was missing, would it possible to know when the table was be deleted by some kind of transaction log?

View 6 Replies

C# - How To Format A Transaction Id

Feb 25, 2010

What is the best way to format a transaction id?Conditions Max 15 characters: XXXXXXXXXXXXXXX -All transaction must be unique -Can contain both numerical and alphabetical characters -May contain Year, month, day

View 1 Replies

Commit Transaction In SQL Server

Dec 10, 2010

table 1
[Code]....
Table 2
[Code]....
my stored procedure
[Code]....

when ever i m passing the wrong the value in second table while updating its not updating the table but the problem it is inserting the value in first table i want the whole trans should proceed if success if not rollback

View 2 Replies

SQL Server :: How To Check Transaction Log

Sep 23, 2010

I know these 2 commands

sp_who and sp_who2 → knowing who are updateing

DBCC log (DB_NAME,4) → I can't really understand these information..

just wondering does there exists a log file, so we can check who have updated database from it?

View 3 Replies

ADO.NET :: Save Log On Uncomplete Transaction

Feb 16, 2011

I want to know is there any method or any concept to save transactions before system crash or failure. I am doing project in C# and backend is sql server 2005.

View 1 Replies

ADO.NET :: TransactionScope And Explicit Transaction In It

Feb 23, 2011

[Code]....

Now,

1. If In transaction scope if 1st Transaction is commited, buting 2nd one exception occurs and it is rolled back

2. Any other exception occurs, after 1st transaction is completed/commited

Here, explicit transactions are used. In both cases does all transactions in the scope are revert back? What are the possiblities here?

View 7 Replies

ADO.NET :: Entity Framework Transaction?

Feb 2, 2011

i'm using the entity data model to insert data to my database. the thing is that when inserting data to more than one table i want to ensure that all actions completed correctly(or catch an exeption if not).

View 1 Replies







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