Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
GeneralRe: From DataTable to multi-Line Chart Pin
Rminator6-Jul-11 22:39
Rminator6-Jul-11 22:39 
GeneralRe: From DataTable to multi-Line Chart Pin
BobJanova7-Jul-11 4:31
BobJanova7-Jul-11 4:31 
GeneralRe: From DataTable to multi-Line Chart Pin
Rminator7-Jul-11 4:59
Rminator7-Jul-11 4:59 
GeneralRe: From DataTable to multi-Line Chart Pin
Rminator14-Jul-11 20:26
Rminator14-Jul-11 20:26 
QuestionWindows Name Pin
M Riaz Bashir6-Jul-11 19:47
M Riaz Bashir6-Jul-11 19:47 
AnswerRe: Windows Name PinPopular
Wayne Gaylard6-Jul-11 20:42
professionalWayne Gaylard6-Jul-11 20:42 
GeneralRe: Windows Name Pin
M Riaz Bashir6-Jul-11 20:43
M Riaz Bashir6-Jul-11 20:43 
QuestionWhy is the Insert done once while there are 13 Records Pin
Vimalsoft(Pty) Ltd6-Jul-11 8:20
professionalVimalsoft(Pty) Ltd6-Jul-11 8:20 
Good Evening All

i have a Function in my DataLayer that is defined like this

public bool SynchProductsCategoryToCBD(IList<EcashProductCatModel> model)
        {
            con = new SqlConnection(strCon);

            cmdinsert = new SqlCommand("sp_AddProductCategory"); //needs to be created
            cmdinsert.CommandType = CommandType.StoredProcedure;
            cmdinsert.Connection = con;


            bool Error = false;
            try
            {
                con.Open();

                foreach (EcashProductCatModel ecash in model)
                {
                        cmdinsert.Parameters.Add("@CATEGORY_ID", SqlDbType.Int).Value = ecash.CATEGORY_ID;
                        cmdinsert.Parameters.Add("@CATEGORY_DESCRIPTION", SqlDbType.VarChar).Value = ecash.CATEGORY_DESCRIPTION;
                        cmdinsert.Parameters.Add("@SCHOOLID", SqlDbType.Int).Value = ecash.SCHOOLID;
                        cmdinsert.ExecuteNonQuery();
           
                }  
                Error = true;
            }
            catch (Exception ex)
            {
                Logger.LoggerClient logger = new Logger.LoggerClient();
                //Collect Data
                Logger.LoggerModel models = new Logger.LoggerModel();
                models.iTYPEID = Convert.ToInt32(GenericEnum.Logging_Type.ECASH_SYCH);
                models.sLOGGER_CLASS = "eCashDatalayer";
                models.sLOGGER_DESCRIPTION = ex.Message;
                models.sLOGGER_FUNCTION = "SynchProductsCategoryToCBD";
                models.sLOGGER_LOGGEDINUSERID = "";
                models.sLOGGER_PAGE = "NA";
                models.sLOGGER_VALUE = "NA";
                logger.LogIncident(models);
            }
            finally
            {
                con.Close();
            }
            return Error;
        }


and i pass the List of objects, i have inspected the list and it contains valid values and i had 13 records , but in the database i get only 1 record

What is it that i am doing wrong ?

Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/

AnswerRe: Why is the Insert done once while there are 13 Records Pin
#realJSOP6-Jul-11 8:44
mve#realJSOP6-Jul-11 8:44 
GeneralRe: Why is the Insert done once while there are 13 Records Pin
Vimalsoft(Pty) Ltd6-Jul-11 9:14
professionalVimalsoft(Pty) Ltd6-Jul-11 9:14 
AnswerRe: Why is the Insert done once while there are 13 Records Pin
GenJerDan6-Jul-11 9:19
GenJerDan6-Jul-11 9:19 
GeneralRe: Why is the Insert done once while there are 13 Records Pin
Vimalsoft(Pty) Ltd6-Jul-11 9:41
professionalVimalsoft(Pty) Ltd6-Jul-11 9:41 
AnswerRe: Why is the Insert done once while there are 13 Records Pin
PIEBALDconsult6-Jul-11 14:19
mvePIEBALDconsult6-Jul-11 14:19 
Questionhow to display the output from LM35 on pc in C# Pin
aeman6-Jul-11 4:47
aeman6-Jul-11 4:47 
AnswerRe: how to display the output from LM35 on pc in C# Pin
Alan N6-Jul-11 7:33
Alan N6-Jul-11 7:33 
GeneralRe: how to display the output from LM35 on pc in C# Pin
aeman6-Jul-11 22:14
aeman6-Jul-11 22:14 
GeneralRe: how to display the output from LM35 on pc in C# Pin
Richard MacCutchan7-Jul-11 1:51
mveRichard MacCutchan7-Jul-11 1:51 
GeneralRe: how to display the output from LM35 on pc in C# Pin
aeman7-Jul-11 2:02
aeman7-Jul-11 2:02 
GeneralRe: how to display the output from LM35 on pc in C# Pin
Richard MacCutchan7-Jul-11 2:23
mveRichard MacCutchan7-Jul-11 2:23 
AnswerRe: how to display the output from LM35 on pc in C# Pin
PIEBALDconsult6-Jul-11 14:20
mvePIEBALDconsult6-Jul-11 14:20 
GeneralRe: how to display the output from LM35 on pc in C# Pin
aeman6-Jul-11 22:15
aeman6-Jul-11 22:15 
GeneralRe: how to display the output from LM35 on pc in C# Pin
BobJanova6-Jul-11 22:32
BobJanova6-Jul-11 22:32 
GeneralRe: how to display the output from LM35 on pc in C# Pin
aeman6-Jul-11 23:48
aeman6-Jul-11 23:48 
GeneralRe: how to display the output from LM35 on pc in C# Pin
Thomas Krojer7-Jul-11 0:37
Thomas Krojer7-Jul-11 0:37 
GeneralRe: how to display the output from LM35 on pc in C# Pin
aeman7-Jul-11 1:58
aeman7-Jul-11 1:58 

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.