Программирование - это просто
Advertisement
arrow C# arrow C#. arrow C#. 3. .
06.02.2023 .
1:
C#
Delphi
Web-
Excel-
.
C#. 3. . E-mail
megabax   
10.03.2012 .
New Page 1

C#. 3. .

 

Visual Studio 2010 SQL. . . , , "":

     C#.  3.  .

:

        private void button1_Click(object sender, EventArgs e)

        {

            waresTableAdapter.Update(myBaseDataSet);

        }

, : " " . , " UpdateCommand DataRow ":

     C#.  3.  .

, UpdateCommand. :

   private void button1_Click(object sender, EventArgs e)

       {

            SqlCeCommand command = new SqlCeCommand(

                "UPDATE wares SET ID = @ID, Name = @Name, Price=@Price "+

                "WHERE (ID = @ID)");

            command.Connection = waresTableAdapter.Connection;

            waresTableAdapter.Adapter.UpdateCommand = command;

 

            SqlCeParameter parametr;

 

            // ID

            parametr = new SqlCeParameter("@ID", SqlDbType.Int);

            parametr.SourceColumn = "ID";

            command.Parameters.Add(parametr);

 

            // Name

            parametr = new SqlCeParameter("@Name", DbType.String);

            parametr.SourceColumn = "Name";

            command.Parameters.Add(parametr);

 

            // Price

            parametr = new SqlCeParameter("@Price", SqlDbType.Float);

            parametr.SourceColumn = "Price";

            command.Parameters.Add(parametr);

 

            waresTableAdapter.Update(myBaseDataSet.Wares);

        }

. , ID , , ID :

     C#.  3.  .

.


,   "Microsoft Visual Studio 2010 Professional", Microsoft.. 


 

 

 

 

 

 

 

 

 

 

 

 

 

( 22.03.2021 . )
 
« .   . »
 
© 2023 Программирование - это просто
Joomla! - , GNU/GPL.
© 2005-2008 Joom.Ru - Joomla!
Design by Mamboteam.com | Powered by Mambobanner.de
  .