3.4.10

with Sql Generate DAL Parameters

***********************************************************************
select 'if (string.IsNullOrEmpty(myBatchFileResult.' + substring(column_name,1,Len(column_name))+')){
myCommand.Parameters.AddWithValue("@' + substring(column_name,1,Len(column_name)) +'", DBNull.Value);
}
else
{
myCommand.Parameters.AddWithValue("@' + substring(column_name,1,Len(column_name))+'", myBatchFileResult.'+ substring(column_name,1,Len(column_name)) +');



}'

from Information_Schema.columns where Table_Name ='BatchUploadResult'
***************************************************


select 'if (string.IsNullOrEmpty(myBatchFileResult.' + substring(column_name,1,Len(column_name))+')){
myCommand.Parameters.AddWithValue("@' + substring(column_name,1,Len(column_name)) +'", DBNull.Value);
}
else
{
myCommand.Parameters.AddWithValue("@' + substring(column_name,1,Len(column_name))+'", myBatchFileResult.'+ substring(column_name,1,Len(column_name)) +');



}'

from Information_Schema.columns where Table_Name ='StudentBatchResult'
*************************************************************************

No comments: