Tema: Re: DataSet Multiple SQL result (ar imanoma?)
Autorius: Jornada Del Muerto
Data: 2010-02-02 16:17:04
Aplamai idomus kodas, as tu BeginLoadData niekad nedarau ir veikia jei kraunu lenta.. tas man keista.
O visumoj idomu ir issiverciama be DataAdapter, reiks bandyt, dabar biski uzimtas, bet veliau researcha padarysiu, tiesiog projekto vieno etapo pabaiga :)
"VyvIT" <labas@viso.iki> wrote in message news:hk9agf$sfe$1@trimpas.omnitel.net...
> mazdaug taip gal :]
>
> SqlDataReader reader = null;
> var tables = new DataTable[2];
> try
> {
> command.CommandTimeout = 120;
> lock (command.Connection)
> {
> if (command.Connection.State != ConnectionState.Open)
> command.Connection.Open();
>
> reader = command.ExecuteReader();
> for (int i = 0; i < tableCount; i++)
> {
>
> var table = new DataTable
> {
> Locale =
> System.Globalization.CultureInfo.InvariantCulture
> };
> table.BeginLoadData();
> table.Load(reader);
> table.EndLoadData();
> table.TableName = string.Format("Results{0}", i);
> tables[i] = table;
> }
> reader.Close();
> }
> }
> catch (SqlException)
> {
> if (reader != null)
> reader.Close();
> throw;
> }
> return tables;
>
>
>
> "Jornada Del Muerto" <ask@me.email> wrote in message
> news:hk9a31$rns$1@trimpas.omnitel.net...
>> Sveiki,
>>
>> Tokia briedova ideja kilo, pvz turiu MSSQL ir as galiu proceduroje
>> daryti:
>>
>> CREATE PROCEDURE MyProc AS
>>
>> Select * From lenta1 where type=1
>> Select * From lenta1 where type=10
>> Select * From lenta2
>> Select * From lenta3
>>
>> Tada jei kokiam nors manageryje paleisit tokia proc tai kaip visi zino
>> grazins kelis rezultatus, o ar eitu taip kad ir i DataSet'a paimt per
>> ADO.NET
>>
>>
>> Tipo daugmaz standartinis kreipimasis i SQL ir DataSet.Load, yra siaip
>> toks metodas bet jis tada klausai lentu vardu, bet as gal 10 selectu
>> skirtingu is tos pacios darau...
>>
>> Dar yra DataAdapter.Fill bet as negaliu gauti is IDbConnection jo
>> IDataAdapter, nes dirbu interface'u lygyje...
>>
>> Gal kas bande? pavyko nepavyko? ar siaip turi nuomuone ?
>>
>
>