Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataSet readonly from a stored procedure
Message
 
 
À
22/11/2010 06:58:06
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 4.0
Database:
MS SQL Server
Divers
Thread ID:
01489891
Message ID:
01490117
Vues:
45
Hi Tim,

I would not suggest dynamic SQL for such task, so you got me confused with someone.

I'd suggest to pass IDs as a table if you're using SQL Server 2008.

>Hi Bonnie,
>I am home but will be out teaching today and tomorrow so no real time. I do see some of what he sent me. Here was his specific comment.
>
>"What causes the incoming data from that DataAdapter to configure the rows in the DataTable as ReadOnly or NOT ReadOnly? In the attached screenshot, at line 600 the nano-second that the DataAdapter fills the DataSet, the Rows of the DataTable of that DataSet switch from ReadOnly = F to ReadOnly=T when one stored procedure is called but stays ReadOnly=F when another stored procedure is called. "
>
>The stored procedure is one that was posted here a week or so ago that Naomi helped me with. It isn't on this table or columns, but is just like this one. We needed to get records that are included within a list of values and or with a specific column = to a value. And no duplicate rows.
>
>The SP that works fine is a straight forward select but from the same table and includes the same rows.
>
>Bob, there isn't any columns being named specific but there is a cast in this.
>
>
>/*
>      SET NOCOUNT ON;
>      DECLARE @SQL varchar(600)
> 
>      SET @SQL = 'SELECT 
>            AddressNumber,
>            ApartmentNumber,
>            LastUpdated,
>            LocationID,
>            LocationTypeID,
>            PostalCode,
>            RecordStart,
>            Status,
>            StreetName,
>            UpdatedBy
>      FROM [dbo].[Location]
>      WHERE 
>            AddressNumber IN (' + @AddressNumbers + ') OR
>            PostalCode = '+CAST(@PostalCode as varchar(10))
>      EXEC(@SQL)
>*/
>
>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform