I can't for the life of me adapt
http://www.codeproject.com/KB/cs/ETLWithCSharp.aspx
to work with a database. Here is the code (it is short enough that I
don't feel it cumbersome to just post it). The Assert fails, and nor
do I receive an exception about database access, nor do I see any
activity in SQL Profiler. It just doesn't work. Could someone tell
me if I'm doing something blatantly wrong here?
Thanks.
the test:
[TestClass]
[DeploymentItem(@".\SampleData\names.txt", "SampleData")]
public class UserNameWriteDBTest : BaseTestClass
{
[TestMethod]
public void CanWriteDB()
{
var numprocessed = 0;
var unr = new UserNameWriteToDB("uvmcar");
unr.OnRowProcessed += delegate { numprocessed++ };
var userRecords = new TestProcess(
new UserNameRead(@".\SampleData\names.txt"),
unr,
new GetInputFromDB("uvmcar")
);
Assert.IsTrue(numprocessed > 0);
}
}
UserNameWriteToDB:
public class UserNameWriteToDB : ConventionOutputCommandOperation
{
public UserNameWriteToDB(string connectionString) :
base (connectionString){
Command = "INSERT INTO Users (Id,Name) VALUES(@Id,@Name)";
}
}
GetInputFromDB:
public class GetInputFromDB : ConventionInputCommandOperation
{
public GetInputFromDB(string connectionStringName)
: base(connectionStringName){
Command = "SELECT * FROM Users";
}
}
--
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rhino-tools-dev?hl=en.