Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Tuesday, March 20, 2012

Data Read / Write problem with concurrent users on with dll

Hi,

I have a web app, that runs fine, except for one particular section that uses a class called by an event in the code behind. The class resides as a dll in the bin folder.


We had no problems during testing, when only one user was running this dll. Problems soon occurred when multiple users tried running it. Here's the error & stack:


06/02/2007 09:25:26 ==> cburns ==> There is already an open DataReader associated with this Command which must be closed first. at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
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 ESP.Validator.Data.DatabaseEvents.DatabaseEventManager.Read(IEventable eventObject, Int16 eventType, DateTime earliestDate, DateTime latestDate) in C:\My Path\Validator\Validator.NET\Data\DatabaseEvents\DatabaseEventManager.cs:line 92
at ESP.Validator.Data.Translink.CATCard.GetDespatchDate() in C:\My Path\Projects\Validator\Validator.NET\Data\Translink\CATCard.cs:line 94
at ESP.Validator.Data.Translink.ExistingSchemeEntitlement.ReadCards() in C:\My Path\Projects\Validator\Validator.NET\Data\Translink\ExistingSchemeEntitlement.cs:line 215
at ESP.Validator.Data.Translink.ExistingSchemeEntitlement.Read() in C:\My Path\Projects\Validator\Validator.NET\Data\Translink\ExistingSchemeEntitlement.cs:line 147
at ESP.Validator.Data.Translink.TranslinkApplicant.ReadEntitlements() in C:\My Path\Projects\Validator\Validator.NET\Data\Translink\TranslinkApplicant.cs:line 369
at ESP.Validator.Data.Translink.TranslinkApplicant.Read() in C:\My Path\Projects\Validator\Validator.NET\Data\Translink\TranslinkApplicant.cs:line 353
at ESP.Validator.Data.Translink.PrePrintedLetter.Read() in C:\My Path\Projects\Validator\Validator.NET\Data\Translink\PrePrintedLetter.cs:line 282
at ESP.Validator.ValidationProcessor.Read(ValidationSubject subject) in C:\My Path\Projects\Validator\Validator.NET\ValidationProcessor.cs:line 82
at clear_applications_scan_applications.ProcessValidation()

It seems the data reader is getting reused. We have ensured after each read the reader is closed. Though all users are using the same connection string. Could it be a connection pool problem, with the connection being overwritten during execution? Should i edit it according to the users logon?

I am really at a loss for ideas, and I don't mind admitting I am a bit out of my depth with this one!!

Any ideas/suggestions would be greatly appreciated.

Thanks

Hi Assimalyst,

Based on the exception message, we can see that this is not because of reusing of the SqlDataReader, but reusing the SqlConnection.

Generally, on a single SqlConnection, there can only be 1 open SqlDataReader exist at the same time. If a using is trying to open another one, this exception is thrown.

In ADO.NET 2.0, a new concept is involved called Multiple Active Result Sets (MARS). This enables you open multiple DataReaders on a single connection. To achieve this, you only need to add "MultipleActiveResultSets=True" in your connection string. That will prevent the exception from being thrown.

Please check the following links for more information:

http://msdn2.microsoft.com/en-us/library/cfa084cz.aspx

HTH. If anything is unclear, please feel free to mark this post as Not Answered and post your reply. Thanks!

sql

data provider cannot be found

Hi there,

I am trying to use the new ListView control in VS2008 in an ASP.Net app. My problem starts already with the datasource. I drag and drop a SqlDataSource and select

Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5)

I can connect to the database and test the query in the wizard (I do not need to use a password??)

This is the webconfig entry

<add name="ConnectionString" connectionString="Data Source=C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples\Northwind.sdf" providerName="Microsoft.SqlServerCe.Client.3.5"/>

I add the following line in the page load event

AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);

However I get the error message that the data provider cannot be found and it might not be installed. I added the reference and also gave the folder above ASP.NET full access rights.

Anyone else encountered this problem. It is quiet strange? Thanks a lot for your help.

Cheers,

Chris

Hi,

From your description, it seems that you are wondering why the database creating wizard doesn't ask for your userid and password, and another question is why does you application can't find the data provider, right?

For you first question, I think what the database you created is in Windows Authentication mode, so when you create a database connection wizard, the wizard connects to your database by your windows account. If you want to change the windows authentication mode, you may open your sqlserver enterprise manager, and change the authentication mode to SQL mixed authentication mode in the security part.

Second, from the provider in your connection string, you are using .NET Framework Data Provider for Microsoft SQL Server Compact 3.5. But the application you created is a ASP.NET application, so are you sure you want to connect a SQLServer compact edition. Generally, you should create a SQLServer database and use "System.Data.SqlClient" as the providername in your connection string.

Thanks.

|||

Hi Michael,

of course you are right. I realised yesterday that I just use the wrong data provider. Stupid me. All works fine now.

Thanks again,

Cheers,

Chris

sql

Saturday, February 25, 2012

Data mapping and Importing app for SQL server

Hello,

Our company often receives data from outside sources to add to our application. This data is usually provided to us in Excel, CSV, XML, etc. The files that we receive usually have different columns from the columns in our database, so we have to map these columns to our table structure to import.

I'm looking for an application that will easily allow me to load up the data file (whatever type it may be), expose the columns in the data file, allow me to map these columns in our SQL server, then import the data. I know that this can be done as DTS, however I'm looking for alternatives. Does anyone have any recommendations?

Thanks in advance.

I just dont have a solution to your post but i have the same problem. I just want to get notifications on reply event of this thread. Hopefully some one will answer you and i will benefit.

Friday, February 24, 2012

Data loss

We have a situation in here were one of my collegue has accidently
uninstalled a Delphi app.....how will I recover data that is lost?Are
there any tools to recover the data?"andz" <anand411@.gmail.com> wrote in news:1153300202.168067.257380
@.s13g2000cwa.googlegroups.com:

> We have a situation in here were one of my collegue has accidently
> uninstalled a Delphi app.....how will I recover data that is lost?Are
> there any tools to recover the data?
What exactly is the problem regarding the data? They should still be in the
database, or does the uninstall program delete the database as well? If so,
I guess you'll have to find the latest backup, and do a restore of the
data.
Ole Kristian Bangs
MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging, MCTS, MCITP|||Many Thanks for your reply...
Yes, the application uninstalled the dbs aswell...we have recovered
some of the tables via a recovery tool...but some tables give the
following error - corrupt table or index header while opening.
When trying to repair using paradox it comes with error number 30704 -
u have tried to use an unassigned variable.A variable must be assigned
a value before you can use it..
Andz
Ole Kristian Bang=E5s wrote:

> "andz" <anand411@.gmail.com> wrote in news:1153300202.168067.257380
> @.s13g2000cwa.googlegroups.com:
>
> What exactly is the problem regarding the data? They should still be in t=
he
> database, or does the uninstall program delete the database as well? If s=
o,
> I guess you'll have to find the latest backup, and do a restore of the
> data.
> --
> Ole Kristian Bang=E5s
> MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging, MCTS, MCITP|||"andz" <anand411@.gmail.com> wrote in
news:1153310037.438389.188180@.m73g2000cwd.googlegroups.com:

> Many Thanks for your reply...
> Yes, the application uninstalled the dbs aswell...we have recovered
> some of the tables via a recovery tool...but some tables give the
> following error - corrupt table or index header while opening.
> When trying to repair using paradox it comes with error number 30704 -
> u have tried to use an unassigned variable.A variable must be assigned
> a value before you can use it..
You'll either need the database files (flat file backup) or some other kind
of backup, otherwise I guess there is very little you can do. (That I know
of at least).
Ole Kristian Bangs
MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging, MCTS, MCITP

Data loss

We have a situation in here were one of my collegue has accidently
uninstalled a Delphi app.....how will I recover data that is lost?Are
there any tools to recover the data?"andz" <anand411@.gmail.com> wrote in news:1153300202.168067.257380
@.s13g2000cwa.googlegroups.com:
> We have a situation in here were one of my collegue has accidently
> uninstalled a Delphi app.....how will I recover data that is lost?Are
> there any tools to recover the data?
What exactly is the problem regarding the data? They should still be in the
database, or does the uninstall program delete the database as well? If so,
I guess you'll have to find the latest backup, and do a restore of the
data.
--
Ole Kristian Bangås
MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging, MCTS, MCITP|||Many Thanks for your reply...
Yes, the application uninstalled the dbs aswell...we have recovered
some of the tables via a recovery tool...but some tables give the
following error - corrupt table or index header while opening.
When trying to repair using paradox it comes with error number 30704 -
u have tried to use an unassigned variable.A variable must be assigned
a value before you can use it..
Andz
Ole Kristian Bang=E5s wrote:
> "andz" <anand411@.gmail.com> wrote in news:1153300202.168067.257380
> @.s13g2000cwa.googlegroups.com:
> > We have a situation in here were one of my collegue has accidently
> > uninstalled a Delphi app.....how will I recover data that is lost?Are
> > there any tools to recover the data?
> What exactly is the problem regarding the data? They should still be in t=he
> database, or does the uninstall program delete the database as well? If s=o,
> I guess you'll have to find the latest backup, and do a restore of the
> data.
> --
> Ole Kristian Bang=E5s
> MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging, MCTS, MCITP|||"andz" <anand411@.gmail.com> wrote in
news:1153310037.438389.188180@.m73g2000cwd.googlegroups.com:
> Many Thanks for your reply...
> Yes, the application uninstalled the dbs aswell...we have recovered
> some of the tables via a recovery tool...but some tables give the
> following error - corrupt table or index header while opening.
> When trying to repair using paradox it comes with error number 30704 -
> u have tried to use an unassigned variable.A variable must be assigned
> a value before you can use it..
You'll either need the database files (flat file backup) or some other kind
of backup, otherwise I guess there is very little you can do. (That I know
of at least).
--
Ole Kristian Bangås
MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging, MCTS, MCITP

Data Locking Method

Dear All,
I have a receiving application. The app works like below:
1. The operator must key in the delivery notes of the truck at the
receiving offices
2. The operator scans each items within a truck at the warehouse.
After finish unloading the items of one delivery notes (of truck), I
want the operator at the warehouse can't add or delete items anymore.
So the reconciliation report won't be changed in the future.
Does anyone have any suggestion how to solve this problem?
Thanks
Robert Lie
BEGIN TRANSACTION when the delivery is put on the truck for delivery.
COMMIT TRANSACTION when the deliver arrives at the warehouse and is put on
shelf.
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:emexYRTrFHA.2996@.tk2msftngp13.phx.gbl...
> Dear All,
> I have a receiving application. The app works like below:
> 1. The operator must key in the delivery notes of the truck at the
> receiving offices
> 2. The operator scans each items within a truck at the warehouse.
> After finish unloading the items of one delivery notes (of truck), I want
> the operator at the warehouse can't add or delete items anymore.
> So the reconciliation report won't be changed in the future.
> Does anyone have any suggestion how to solve this problem?
> Thanks
> Robert Lie
|||On Tue, 30 Aug 2005 14:37:52 +0700, Robert Lie
<robert.lie24@.gmail.com> wrote:
>I have a receiving application. The app works like below:
>1. The operator must key in the delivery notes of the truck at the
>receiving offices
>2. The operator scans each items within a truck at the warehouse.
>After finish unloading the items of one delivery notes (of truck), I
>want the operator at the warehouse can't add or delete items anymore.
>So the reconciliation report won't be changed in the future.
>Does anyone have any suggestion how to solve this problem?
Not really a data locking issue, it's more about application design, i
think.
J.

Data Locking Method

Dear All,
I have a receiving application. The app works like below:
1. The operator must key in the delivery notes of the truck at the
receiving offices
2. The operator scans each items within a truck at the warehouse.
After finish unloading the items of one delivery notes (of truck), I
want the operator at the warehouse can't add or delete items anymore.
So the reconciliation report won't be changed in the future.
Does anyone have any suggestion how to solve this problem?
Thanks
Robert LieBEGIN TRANSACTION when the delivery is put on the truck for delivery.
COMMIT TRANSACTION when the deliver arrives at the warehouse and is put on
shelf.
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:emexYRTrFHA.2996@.tk2msftngp13.phx.gbl...
> Dear All,
> I have a receiving application. The app works like below:
> 1. The operator must key in the delivery notes of the truck at the
> receiving offices
> 2. The operator scans each items within a truck at the warehouse.
> After finish unloading the items of one delivery notes (of truck), I want
> the operator at the warehouse can't add or delete items anymore.
> So the reconciliation report won't be changed in the future.
> Does anyone have any suggestion how to solve this problem?
> Thanks
> Robert Lie|||On Tue, 30 Aug 2005 14:37:52 +0700, Robert Lie
<robert.lie24@.gmail.com> wrote:
>I have a receiving application. The app works like below:
>1. The operator must key in the delivery notes of the truck at the
>receiving offices
>2. The operator scans each items within a truck at the warehouse.
>After finish unloading the items of one delivery notes (of truck), I
>want the operator at the warehouse can't add or delete items anymore.
>So the reconciliation report won't be changed in the future.
>Does anyone have any suggestion how to solve this problem?
Not really a data locking issue, it's more about application design, i
think.
J.

Data Locking Method

Dear All,
I have a receiving application. The app works like below:
1. The operator must key in the delivery notes of the truck at the
receiving offices
2. The operator scans each items within a truck at the warehouse.
After finish unloading the items of one delivery notes (of truck), I
want the operator at the warehouse can't add or delete items anymore.
So the reconciliation report won't be changed in the future.
Does anyone have any suggestion how to solve this problem?
Thanks
Robert LieBEGIN TRANSACTION when the delivery is put on the truck for delivery.
COMMIT TRANSACTION when the deliver arrives at the warehouse and is put on
shelf.
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:emexYRTrFHA.2996@.tk2msftngp13.phx.gbl...
> Dear All,
> I have a receiving application. The app works like below:
> 1. The operator must key in the delivery notes of the truck at the
> receiving offices
> 2. The operator scans each items within a truck at the warehouse.
> After finish unloading the items of one delivery notes (of truck), I want
> the operator at the warehouse can't add or delete items anymore.
> So the reconciliation report won't be changed in the future.
> Does anyone have any suggestion how to solve this problem?
> Thanks
> Robert Lie|||On Tue, 30 Aug 2005 14:37:52 +0700, Robert Lie
<robert.lie24@.gmail.com> wrote:
>I have a receiving application. The app works like below:
>1. The operator must key in the delivery notes of the truck at the
>receiving offices
>2. The operator scans each items within a truck at the warehouse.
>After finish unloading the items of one delivery notes (of truck), I
>want the operator at the warehouse can't add or delete items anymore.
>So the reconciliation report won't be changed in the future.
>Does anyone have any suggestion how to solve this problem?
Not really a data locking issue, it's more about application design, i
think.
J.

Data load: want to redirect extant rows in table to a file

We are working on a DataWarehouse app. The DW has been loaded wiith transactional data from the start of September. and we want refresh the DW with a full load from the original source. This full load wil consist largely of the same records that we loaded initially in the DW but some records will be new and others will have changed.

During the load I want to direct input records NOT already in the DW to a "mods" table and ignore those input records that alreayd exist in the DW. Can SSIS help out with this task?

TIA,

Barkingdog

Use a lookup task to compare the input with the existing table. Redirect errors to the "mods" table and ignore all records where the lookup succeeds.