ODS lets you build your own method that does the staged insert. I'll post here some pseudo code of what it might look like:
public void InsertAlldbo_CustomerInfo(Guid userkey, string firstname, string lastname, string billingaddress, string city, string state, , string gender, DateTime birthdate, Double height, int planname_id)
{
SqlConnection connection = new SqlConnection(connectionString);
String insertString = "INSERT INTO dbo.CustomerInfo (";
insertString += "UserKey";
insertString += ",FirstName";
insertString += ",LastName";
insertString += ",BirthDate";
insertString += ",Height";
insertString += ",PlanName_id";
insertString += ") VALUES (";
insertString += "@userkey";
insertString += ",@firstname";
insertString += ",@lastname";
insertString += ",@height";
insertString += ",@planname_id";
insertString += "); ";
SqlCommand cmd = new SqlCommand(insertString, connection);
cmd.Parameters.Add("@userkey", SqlDbType.UniqueIdentifier, 16).Value = userkey;
cmd.Parameters.Add("@firstname", SqlDbType.VarChar, 50).Value = firstname == null ? String.Empty : firstname;
cmd.Parameters.Add("@lastname", SqlDbType.VarChar, 50).Value = lastname == null ? String.Empty : lastname;
cmd.Parameters.Add("@height", SqlDbType.Float, 17).Value = height;
cmd.Parameters.Add("@planname_id", SqlDbType.Int, 0).Value = planname_id;
try
{
connection.Open();
cmd.ExecuteNonQuery();
}
catch (SqlException err)
{
throw new ApplicationException("TestODS Insert Error." + err.ToString());
}
finally
{
connection.Close();
}
AND DO SOME MORE INESRT STUFF INTO ANOTHE RTABLE..
}
Peter Kellner
http://73rdstreet.com and blogging at
http://PeterKellner.netMVP, ASP.NET