Click here to Skip to main content
15,894,405 members
Home / Discussions / C#
   

C#

 
AnswerRe: basic understanding in c# threading. PinPopular
Luc Pattyn3-Nov-09 2:24
sitebuilderLuc Pattyn3-Nov-09 2:24 
GeneralRe: basic understanding in c# threading. Pin
tomerb153-Nov-09 2:35
tomerb153-Nov-09 2:35 
GeneralRe: basic understanding in c# threading. Pin
Luc Pattyn3-Nov-09 4:36
sitebuilderLuc Pattyn3-Nov-09 4:36 
AnswerRe: basic understanding in c# threading. Pin
LimitedAtonement3-Nov-09 6:11
LimitedAtonement3-Nov-09 6:11 
QuestionExcel Chart(2007) data selection from c# Pin
leshu3-Nov-09 2:08
leshu3-Nov-09 2:08 
QuestionHow to Insert Data into database with SingleFunction in C# Pin
Phaneendra Varanasi3-Nov-09 1:36
Phaneendra Varanasi3-Nov-09 1:36 
AnswerRe: How to Insert Data into database with SingleFunction in C# Pin
dan!sh 3-Nov-09 1:42
professional dan!sh 3-Nov-09 1:42 
AnswerRe: How to Insert Data into database with SingleFunction in C# Pin
Md. Marufuzzaman3-Nov-09 3:24
professionalMd. Marufuzzaman3-Nov-09 3:24 
Try the following...

<pre> public int ExecuteNonQuery(string strConnectionString
                                       , string strStoredProcedure
                                       , SqlParameter[] ObjSQLParameter)
            {
                  //   declare variables
                  SqlConnection ObjSqlConnection;
                  SqlCommand ObjSqlCommand;
                  int intRowsAffected = -1;

                  try
                  {
                        //   prepare a connection
                        ObjSqlConnection = new SqlConnection(strConnectionString);

                        //   open connection
                        ObjSqlConnection.Open();

                        //   prepare command
                        ObjSqlCommand = new SqlCommand(strStoredProcedure, ObjSqlConnection);
                        ObjSqlCommand.CommandType = CommandType.StoredProcedure;

                        //   asign parameters to command
                        //SqlParameter collObj ;
                        foreach (SqlParameter collObj in ObjSQLParameter)
                        {
                              ObjSqlCommand.Parameters.Add(collObj);
                        }

                        // execute command
                        intRowsAffected = ObjSqlCommand.ExecuteNonQuery();

                  }

                  catch ()
                  {

                        intRowsAffected = 0;
                  }
                  finally
                  {

                        ObjSqlCommand.Dispose();
                        ObjSqlConnection.Close();
                        ObjSqlConnection.Dispose();

                  }
                  //   return affected rows
                  return intRowsAffected;
            }
</pre>

Thanks
Md. Marufuzzaman


Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.

I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

GeneralRe: How to Insert Data into database with SingleFunction in C# Pin
PIEBALDconsult3-Nov-09 3:57
mvePIEBALDconsult3-Nov-09 3:57 
GeneralRe: How to Insert Data into database with SingleFunction in C# Pin
Md. Marufuzzaman3-Nov-09 5:56
professionalMd. Marufuzzaman3-Nov-09 5:56 
AnswerRe: How to Insert Data into database with SingleFunction in C# Pin
PIEBALDconsult3-Nov-09 3:53
mvePIEBALDconsult3-Nov-09 3:53 
QuestionKnow when data has changed in SQL Server Pin
Rob Ormond3-Nov-09 1:24
Rob Ormond3-Nov-09 1:24 
AnswerRe: Know when data has changed in SQL Server Pin
dan!sh 3-Nov-09 1:35
professional dan!sh 3-Nov-09 1:35 
GeneralRe: Know when data has changed in SQL Server Pin
Rob Ormond3-Nov-09 2:08
Rob Ormond3-Nov-09 2:08 
GeneralRe: Know when data has changed in SQL Server Pin
Md. Marufuzzaman3-Nov-09 6:05
professionalMd. Marufuzzaman3-Nov-09 6:05 
GeneralRe: Know when data has changed in SQL Server Pin
dan!sh 3-Nov-09 16:52
professional dan!sh 3-Nov-09 16:52 
GeneralRe: Know when data has changed in SQL Server Pin
Md. Marufuzzaman3-Nov-09 18:24
professionalMd. Marufuzzaman3-Nov-09 18:24 
QuestionRead SWF WITH C# Pin
zahidhussain3-Nov-09 1:19
zahidhussain3-Nov-09 1:19 
GeneralRe: Read SWF WITH C# Pin
Calla3-Nov-09 1:36
Calla3-Nov-09 1:36 
GeneralRe: Read SWF WITH C# Pin
zahidhussain3-Nov-09 1:40
zahidhussain3-Nov-09 1:40 
GeneralRe: Read SWF WITH C# Pin
Pete O'Hanlon3-Nov-09 2:05
mvePete O'Hanlon3-Nov-09 2:05 
QuestionWhat is the equivalant to constant string array in C#? Pin
CelestialCoder3-Nov-09 0:32
CelestialCoder3-Nov-09 0:32 
AnswerRe: What is the equivalant to constant string array in C#? Pin
Luc Pattyn3-Nov-09 0:51
sitebuilderLuc Pattyn3-Nov-09 0:51 
AnswerRe: What is the equivalant to constant string array in C#? Pin
OriginalGriff3-Nov-09 0:57
mveOriginalGriff3-Nov-09 0:57 
GeneralRe: What is the equivalant to constant string array in C#? Pin
CelestialCoder3-Nov-09 1:35
CelestialCoder3-Nov-09 1:35 

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.