Click here to Skip to main content
15,926,507 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: am i a programmer or not Pin
je_gonzalez12-Apr-09 21:55
je_gonzalez12-Apr-09 21:55 
GeneralRe: am i a programmer or not Pin
dojohansen15-Apr-09 1:48
dojohansen15-Apr-09 1:48 
AnswerRe: am i a programmer or not Pin
dojohansen15-Apr-09 1:38
dojohansen15-Apr-09 1:38 
AnswerRe: am i a programmer or not Pin
Pete O'Hanlon15-Apr-09 2:04
mvePete O'Hanlon15-Apr-09 2:04 
QuestionXML and XSD into to a SQL Database Pin
binarymax9-Apr-09 2:19
binarymax9-Apr-09 2:19 
AnswerRe: XML and XSD into to a SQL Database Pin
dojohansen9-Apr-09 4:09
dojohansen9-Apr-09 4:09 
GeneralRe: XML and XSD into to a SQL Database Pin
binarymax9-Apr-09 8:39
binarymax9-Apr-09 8:39 
GeneralRe: XML and XSD into to a SQL Database Pin
dojohansen15-Apr-09 2:52
dojohansen15-Apr-09 2:52 
Also, I don't know the SportsML schemas or the database, but you might want to check if the native ADO.NET datasets can be made to load these xml documents. Upon re-reading your original posting it seems to me that your primary goal is to minimize the development effort, and datasets might work quite well for this purpose.

Another interesting possibility is to make a SportsML reader that implements the IDataReader interface - then you can use SqlBulkCopy to bulk insert the data. This gives you the best performance and is fairly easy to do if you can base the object on an existing IDataReader implementation.

For example, we wanted to copy some data efficiently from one DB to another. The data included some parent-child relations, so a foreign key in table Child would refer to a row in Parent. And the keys were IDENTITY values provided by each database, so they would be different in each database.

To deal with this I wrote a simple TransformingDataReader class based on SqlDataReader, which already implements IDataReader. Since SqlDataReader is sealed I couldn't inherit from it, but I just embed a reader in my class and delegate most of the interface implementation to that object, like this:

...
        public void Close()
        {
            sqlDataReader.Close();
        }
        public DataTable GetSchemaTable()
        {
            return sqlDataReader.GetSchemaTable();
        }
        public bool NextResult()
        {
            return sqlDataReader.NextResult();
        }
        public void Dispose()
        {
            sqlDataReader.Dispose();
        }
...


The only thing I really wanted to change from SqlDataReader was that when it reads I'd like to be able to modify the data of the row just after it's read internally and before it's passed on to the consumer of the reader. This is easily done like this:

SqlDataReader sqlDataReader;
object[] currentRow;

abstract public void Transform(object[] currentRow);

public bool Read()
{
    if (sqlDataReader.Read())
    {
        sqlDataReader.GetValues(currentRow);
        Transform(currentRow);
        return true;
    }
    currentRow = null;
    return false;
}


I like this solution since it's now very easy to make a reader that does transformations on the fly. For example, you could load a "correspondance" table if you know that in system A values 1, 2, 3 actually mean the same as X, Y, Z does in another system, and by implementing just Transform() you'd be able to do the transformation on the fly during a bulk insert that streams data from one database to the other.

Just to give you some more ideas!
QuestionError "Record(s) cannot be read; no read permission on 'table's name' " when Connect Access 2.0 (.mdb) file in Net ? Pin
Doan Quynh8-Apr-09 23:16
Doan Quynh8-Apr-09 23:16 
AnswerRe: Error "Record(s) cannot be read; no read permission on 'table's name' " when Connect Access 2.0 (.mdb) file in Net ? Pin
Dave Kreskowiak9-Apr-09 4:11
mveDave Kreskowiak9-Apr-09 4:11 
GeneralRe: Error "Record(s) cannot be read; no read permission on 'table's name' " when Connect Access 2.0 (.mdb) file in Net ? Pin
Doan Quynh9-Apr-09 18:29
Doan Quynh9-Apr-09 18:29 
GeneralRe: Error "Record(s) cannot be read; no read permission on 'table's name' " when Connect Access 2.0 (.mdb) file in Net ? Pin
Dave Kreskowiak10-Apr-09 2:28
mveDave Kreskowiak10-Apr-09 2:28 
GeneralRe: Error "Record(s) cannot be read; no read permission on 'table's name' " when Connect Access 2.0 (.mdb) file in Net ? Pin
Doan Quynh11-Apr-09 18:34
Doan Quynh11-Apr-09 18:34 
GeneralRe: Error "Record(s) cannot be read; no read permission on 'table's name' " when Connect Access 2.0 (.mdb) file in Net ? Pin
Dave Kreskowiak11-Apr-09 18:40
mveDave Kreskowiak11-Apr-09 18:40 
GeneralRe: Error "Record(s) cannot be read; no read permission on 'table's name' " when Connect Access 2.0 (.mdb) file in Net ? Pin
Doan Quynh12-Apr-09 15:13
Doan Quynh12-Apr-09 15:13 
QuestionRetrieving the COM class factory for component with CLSID {83F04DB3-9710-11D5-87F6-005004FEB4BD} failed due to the following error: 800703e6. Pin
Renukapadhamanaban8-Apr-09 19:03
Renukapadhamanaban8-Apr-09 19:03 
QuestionWeb Service for Playing Media Player Pin
lynn10077-Apr-09 22:40
lynn10077-Apr-09 22:40 
AnswerRe: Web Service for Playing Media Player Pin
Dave Kreskowiak8-Apr-09 7:42
mveDave Kreskowiak8-Apr-09 7:42 
GeneralRe: Web Service for Playing Media Player Pin
lynn10078-Apr-09 15:15
lynn10078-Apr-09 15:15 
GeneralRe: Web Service for Playing Media Player Pin
Dave Kreskowiak8-Apr-09 17:40
mveDave Kreskowiak8-Apr-09 17:40 
GeneralRe: Web Service for Playing Media Player Pin
lynn10078-Apr-09 18:42
lynn10078-Apr-09 18:42 
GeneralRe: Web Service for Playing Media Player Pin
Dave Kreskowiak9-Apr-09 4:08
mveDave Kreskowiak9-Apr-09 4:08 
GeneralRe: Web Service for Playing Media Player Pin
lynn10079-Apr-09 16:17
lynn10079-Apr-09 16:17 
GeneralRe: Web Service for Playing Media Player Pin
dojohansen9-Apr-09 4:30
dojohansen9-Apr-09 4:30 
GeneralRe: Web Service for Playing Media Player Pin
lynn10079-Apr-09 16:34
lynn10079-Apr-09 16:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.