DataAdapter.Fill with multiple connections

B

Beverly Treadwell

Hi Folks,

I've come across a problem while trying to fill a DataSet.
Hopefully someone can help me out.

What I have is the need to combine data from several databases.
The schema in each DB is the same with the possible exception of unicode vs
nounicode data sets.
(note: at this time there are no unicode characters in use.)

What I do:

Build the connection and sql strings for each DB from an XML file of data:

e.g. strConnection = "Data Source=MyDataSource;User Id=MyUserName;
Password=MyPassword"
strSQL = "SELECTcol1, col2,col3 FROM SchemaName.MyTable Where col1
= 'MyVariable"

At this time the unicode DB is hit last.

Looping through for each connection string I call the funtion to collect the
data and fill the Dataset.

public void fillDataSet(string strSQL, string strConnection)

{

try

{

OracleDataAdapter DataAdapter = new OracleDataAdapter(sqltxt,connectString);

DataAdapter.Fill(clientDataSet);

DataAdapter.Dispose();

}

catch (Exception e)

{

ErrorMessage.Text = e.Message;

}

}

Now this works perfectly fine if each connection returns data:

Connect1 = 1 rows
Connect2 = 1 rows
Connect3 = 1 rows

Dataset = 3 rows ----everything is happy

However, if say Connect 2 returns 0 rows, and if I know Connect3 has 1 rows
to return.
I get:

Connect1 = 1 rows
Connect2 = 0 rows
Connect3 = 0 rows

Dataset = 1 rows -- Connect3 data is missing.

I do not recieve any exceptions back from this.

Hope you can help,

Beverly "prgmrblu" Treadwell
 
B

Beverly Treadwell

Red Faced .... I found the problem in the SQL statement.

Sorry,

Beverly "Prgmrblu" Treadwell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top