Showing posts with label ado. Show all posts
Showing posts with label ado. Show all posts

Wednesday, March 28, 2012

Multithreading?

Hi

Can an application populate two Grids from the database,
simultaneously without using the multithreading using ADO.NET

Thanks in advance
MR_FBI
mr_fbi2020@.yahoo.comMr_FBI (mr_fbi2020@.yahoo.com) writes:
> Can an application populate two Grids from the database,
> simultaneously without using the multithreading using ADO.NET

My guess is that you can't.

From a database perspective, you need two different connections, and that's
not a big deal. ADO .Net can handle that. Then I don't know about data
binding and all that, but since calls in ADO .Net are synchronous, I can't
see how you could fill the grids without multiple threads.

But if you want to know for sure, you should find a forum devoted to
..Net programming.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Erland Sommarskog <sommar@.algonet.se> wrote in message news:<Xns94992E388188Yazorman@.127.0.0.1>...
> Mr_FBI (mr_fbi2020@.yahoo.com) writes:
> > Can an application populate two Grids from the database,
> > simultaneously without using the multithreading using ADO.NET
>
> My guess is that you can't.
> From a database perspective, you need two different connections, and that's
> not a big deal. ADO .Net can handle that. Then I don't know about data
> binding and all that, but since calls in ADO .Net are synchronous, I can't
> see how you could fill the grids without multiple threads.
> But if you want to know for sure, you should find a forum devoted to
> .Net programming.

Thank you, I think you are right. As soon as I get my VS.NET 2003, I
will try myself. :)
Best Regards|||Yes. You can call a stored procedure that returns 2 resultsets. Just fill the
dataset and then bind each table to each datagrid. It's simply a single call
without multi calls/threads.

--
-oj
http://www.rac4sql.net

"Mr_FBI" <mr_fbi2020@.yahoo.com> wrote in message
news:861074e2.0402231132.73707b3b@.posting.google.c om...
> Hi
> Can an application populate two Grids from the database,
> simultaneously without using the multithreading using ADO.NET
> Thanks in advance
> MR_FBI
> mr_fbi2020@.yahoo.com

MultiTable Dataset

First off let me say that some of this is very confusing as it would
appear that the MS SQL group and the ADO.NET group need to get together
to mesh their termonology a bit.
I have a program that uses ReportViewer. To this program I load up an
ADO.NET dataset that contains serveral tables. I also load in an RDLC
report file and display the resulting report.
Up until now this has worked great and I have gotten every report I
need worked out. To keep this simple lets go with something we all
know all so well. My ADO.NET dataset contains three tables:
Customers, Orders, Parts. Each one of them is related to the other.
How does one go about displaying a report that would appear as follows:
Customer 1
-Order 1
--Part 1
--Part 2
--Part 3
-Order 2
--Part 4
--Part 5
Customer 2
-Order3
etc...
I have tried numerous things and read a ton of different posts, but all
to no avail. I know I must be doing something wrong when it comes to
setting this up. There do not seem to be many examples with multiple
tables in a single ADO dataset. Unless I am just missing something.
Also, as an aside, why did MS decide to call each table in a Report a
dataset while a dataset in ADO.NET contains many different tables?
Any help would be greatly appreciated.
Thanks,
AdamYou have to made a Select woth Joins of Customer, Order, Part
So for each part you have one record with the data Customer and Order within.
Then you can group this records in the report and so on.
So you will have only one Resultset for this kind of Report.
OK, The naming-conventions in ReportViewer differs a little bit.
Maybe they will sit together for the next release ;-)
--
LG HOLAN
"akeroo" wrote:
> First off let me say that some of this is very confusing as it would
> appear that the MS SQL group and the ADO.NET group need to get together
> to mesh their termonology a bit.
> I have a program that uses ReportViewer. To this program I load up an
> ADO.NET dataset that contains serveral tables. I also load in an RDLC
> report file and display the resulting report.
> Up until now this has worked great and I have gotten every report I
> need worked out. To keep this simple lets go with something we all
> know all so well. My ADO.NET dataset contains three tables:
> Customers, Orders, Parts. Each one of them is related to the other.
> How does one go about displaying a report that would appear as follows:
> Customer 1
> -Order 1
> --Part 1
> --Part 2
> --Part 3
> -Order 2
> --Part 4
> --Part 5
> Customer 2
> -Order3
> etc...
> I have tried numerous things and read a ton of different posts, but all
> to no avail. I know I must be doing something wrong when it comes to
> setting this up. There do not seem to be many examples with multiple
> tables in a single ADO dataset. Unless I am just missing something.
> Also, as an aside, why did MS decide to call each table in a Report a
> dataset while a dataset in ADO.NET contains many different tables?
> Any help would be greatly appreciated.
> Thanks,
> Adam
>|||Although you can do it, this gets quite messy. The clean way (but it is more
difficult when operating in local mode with the viewer control) is to use
subreports.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"holan" <holan@.noemaol.noemail> wrote in message
news:FA17AF8F-0A21-4A92-BDB9-45A194502517@.microsoft.com...
> You have to made a Select woth Joins of Customer, Order, Part
> So for each part you have one record with the data Customer and Order
> within.
> Then you can group this records in the report and so on.
> So you will have only one Resultset for this kind of Report.
> OK, The naming-conventions in ReportViewer differs a little bit.
> Maybe they will sit together for the next release ;-)
> --
> LG HOLAN
>
> "akeroo" wrote:
>> First off let me say that some of this is very confusing as it would
>> appear that the MS SQL group and the ADO.NET group need to get together
>> to mesh their termonology a bit.
>> I have a program that uses ReportViewer. To this program I load up an
>> ADO.NET dataset that contains serveral tables. I also load in an RDLC
>> report file and display the resulting report.
>> Up until now this has worked great and I have gotten every report I
>> need worked out. To keep this simple lets go with something we all
>> know all so well. My ADO.NET dataset contains three tables:
>> Customers, Orders, Parts. Each one of them is related to the other.
>> How does one go about displaying a report that would appear as follows:
>> Customer 1
>> -Order 1
>> --Part 1
>> --Part 2
>> --Part 3
>> -Order 2
>> --Part 4
>> --Part 5
>> Customer 2
>> -Order3
>> etc...
>> I have tried numerous things and read a ton of different posts, but all
>> to no avail. I know I must be doing something wrong when it comes to
>> setting this up. There do not seem to be many examples with multiple
>> tables in a single ADO dataset. Unless I am just missing something.
>> Also, as an aside, why did MS decide to call each table in a Report a
>> dataset while a dataset in ADO.NET contains many different tables?
>> Any help would be greatly appreciated.
>> Thanks,
>> Adam
>>|||Thanks... I ended up going with subreports and it is working fine.
The joins were not quite going to work for me as my exact situation
wasn't an A to B to C relationship. It was an A-B A-C setup, which
means the joins would have ended up being A-B * C number of records and
that would have gotten really ugly.
thanks,
Adam

Wednesday, March 7, 2012

multiple sessions when using ADO

Hi
I have an application that uses an ADOConnection named CONNECTION1 and an AD
ODataset.The dataset fetches a record for editing it.This dataset has no Con
nectionString and its connection is the CONNECTION1.After opening the datase
t and editing record (befor
posting it) I execute a Stord Procedure to update another record in another
table with CONNECTION1.EXECUTE.
After opening the dataset I see a row in Management -> Current Activity -> P
rocess Info in EnterPrise Manager.And After CONNECTION.EXECUTE statement I s
ee 2 rows in Enterprise Manager.
I do all data modification by one ADOConnection in Delphi5 but SQL SERVER 20
00 do these modification by separate SPIDs (sessions).
How can I prevent this?
Dose ADOConnection or ADODataset have any property to prevent that? Or shoul
d I do anything in SQL SERVER?
ThanksYou may not be able to prevent it. ADO and ODBC, for that matter, will
spawn connections as they see fit. In most cases it does this because the
first SPID is in the middle of some process that has not completed, so the
second SPID is necesary to perform any other task. Normally this does not
cause any problems.
Rand
This posting is provided "as is" with no warranties and confers no rights.

multiple sessions when using ADO

Hi
I have an application that uses an ADOConnection named CONNECTION1 and an ADODataset.The dataset fetches a record for editing it.This dataset has no ConnectionString and its connection is the CONNECTION1.After opening the dataset and editing record (befor
posting it) I execute a Stord Procedure to update another record in another table with CONNECTION1.EXECUTE.
After opening the dataset I see a row in Management -> Current Activity -> Process Info in EnterPrise Manager.And After CONNECTION.EXECUTE statement I see 2 rows in Enterprise Manager.
I do all data modification by one ADOConnection in Delphi5 but SQL SERVER 2000 do these modification by separate SPIDs (sessions).
How can I prevent this?
Dose ADOConnection or ADODataset have any property to prevent that? Or should I do anything in SQL SERVER?
Thanks
You may not be able to prevent it. ADO and ODBC, for that matter, will
spawn connections as they see fit. In most cases it does this because the
first SPID is in the middle of some process that has not completed, so the
second SPID is necesary to perform any other task. Normally this does not
cause any problems.
Rand
This posting is provided "as is" with no warranties and confers no rights.