Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DataTable dtChem = new DataTable();
- ada.Fill(dtChem); // Fills datatable with data from Excel
- cmd.Parameters.Clear();
- cmd.CommandText = "dbo.insertDataChem";
- cmd.Parameters.AddWithValue("@chemResults", dtChem);
- cmd.Parameters.AddWithValue("@eddName", strFileName);
- cmd.ExecuteNonQuery();
- create PROCEDURE [dbo].[insertDataChem]
- @chemResults as dbo.udtableDataChem READONLY
- , @eddName nvarchar(100) = null
- AS
- BEGIN
- INSERT INTO CEDEN_ChemResults
- SELECT cr.SampleDate, cr.*, @eddName, CURRENT_TIMESTAMP FROM @chemResults cr
- END
- CREATE TYPE [dbo].[udtableDataChem] AS TABLE(
- ...
- [MDL] [decimal](30, 15) NULL, // data type changed
- [RL] [decimal](30, 15) NULL, // data type changed
- [DilutionFactor] [nvarchar](200) NULL, // original data type
- [ExpectedValue] [nvarchar](200) NULL, // original data type
- ...
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement