Showing posts with label datasource. Show all posts
Showing posts with label datasource. Show all posts

Tuesday, March 27, 2012

Data fetch

Hi,

I'm using a remote SQL Server Express database with a C# app, and to do so as most of you already know, there's no DataSource available, it's all around SQL. This poses a problem as when I want to browse (1 by 1 in my app, with search utility) the contents of a given table, I have to perform a Select command. Well the problem is when I do this it loads all records into a DataSet (or DataTable), which is fine by me, but one of my tables is expected to reach 400 or 500 records in a few months time. This will mean a lot of loading from the db once the app is launched. Is there a way to make this connection more efective? Thanks

hi,

yes, it's possible... you just have to change your mind about how you fetch and work with data... do no longer "think" in terms of "tables" like in older JET paradgm where you opened a table and navigate via seek methods to the required "record", but "think" in terms of compacted recordsets.. thus filter the data you really need both in horizzontal and vertical terms..

in horizzontal term, returns only the actual columns you need, so provide the restricted column list of the projection you want (do not write SELECT * FROM but SELECT colX, colY, colZ FROM)..

in vertical term, provide a filter condition to the FROM clause in order to return just the "bunch" of rows you are interested with, so write

SELECT <col_list> FROM dbo.Customers WHERE CustomerID = theCustomerYouAreLookingFor

instead of

SELECT * FROM dbo.Customers

and the navigate to the customer row via client side Ado.Net/ADO/whatever seek methods..

regards

Thursday, March 8, 2012

Data Comparison Question

I am not sure if this is the correct forum for my question but I will give it a shot. I want to be able to create a dataset from an ODBC datasource and compare it to existing data in my SQL DB. If there are changes (inserts/updates/deletes) I want to raise seperate events for each row state. Is this possible to do with SSIS/DTS or am I on the wrong track with what I am trying to do?

Have a look at this and see if its any help: http://www.sqlis.com/default.aspx?311

-Jamie

|||Thanks for the link it looks like really good information. Do you think that this will work for all three row states (new/updated/deleted)?|||anybody?|||

These methods tells you whether an incoing row is there or not. i.e. Is it an insert or an update.

It does NOT tell you if a row has been deleted from source. For this you will have to do...well... the opposite.

-Jamie

|||Thank you very much you have been excellent help I was able to do exactly what I needed. For updates should it work the same or do I have to run a check on a particular column(s) and see if they match?|||

The article I linked to should have all the answers. You should use method 2 in there by the way.

-Jamie

|||ok thanks again

Saturday, February 25, 2012

Data access from multiple datasources

Hi,
How to data access from multiple datasources in a crystal report designer?
For one datasource : we can go for connection and connect to our system DSN via ODBC or Native driver connection.Hi,

You can use subreports to access different datasources, if you want to link data from seperate data sources in one query you can obviously not use this approach. Instead I would use a database link from one database to the other data sources.

- Jukka