... the earlier section "Modifying Rows in a DataTable," you need to create a DataAdapter object and set its SelectCommand, InsertCommand, UpdateCommand, and DeleteCommand properties with appropriate ... example creates a SqlCommand object containing a SELECT statement and sets the SelectCommand property of a SqlDataAdapter to that SqlCommand: SqlCommand mySelectCommand = mySqlConnection.CreateCommand(); ... method of your DataAdapter, the appropriate stored procedure is run to push your changes to the database Let's take a look at how to set the InsertCommand, UpdateCommand, and DeleteCommand properties...
Ngày tải lên: 14/12/2013, 13:15
... DisplayDataRow() are as follows: In AddDataRow() Calling myDataTable.NewRow() myNewDataRow.RowState = Detached Calling myDataTable.Rows.Add() myNewDataRow.RowState = Added Calling mySqlDataAdapter.Update() ... a DataRow in a DataTable object Notice that the ProductID to modify is passed as a parameter: public static void ModifyDataRow( DataTable myDataTable, int productID, SqlDataAdapter mySqlDataAdapter, ... how to add a DataRow to a DataTable First, the following code creates a DataSet object named myDataSet and populates it by calling mySqlDataAdapter.Fill(): DataSet myDataSet = new DataSet();...
Ngày tải lên: 14/12/2013, 13:15
Tài liệu Executing a SQL Server Stored Procedure By Using ActiveX Data Objects doc
... cmd.CreateParameter("CustomerID", ADODB.DataTypeEnum.adChar, ADODB.ParameterDirectionEnum.adParamInput, 5) cmd.Parameters.Append(prm) prm.Value = "CHOPS" OpenNorthwindADOConnection(cnn) cmd.ActiveConnection ... txtResults.Text = rstCurr.GetString Catch excp As Exception MessageBox.Show(excp.Message) End Try End Sub The last thing that this routine does is open a recordset based on the Command object This is to the ... Execute method To see the routine in A. 8 executed, click on the button with the caption Stored Procedure with Parameter, located on the frmMain form for this Appendix project ...
Ngày tải lên: 14/12/2013, 20:16
Accessing a database using visual studio NET
... connected to the database, you can view things such as the tables You can also retrieve and modify rows in the tables You can drill down to the tables in the database by clicking the Add icon in the ... Entering a SQL statement You can build SQL statements visually by clicking the Show Diagram button in the toolbar and selecting columns from the table, as shown in Figure 3.29 As you can see, ... selected the ContactName, CompanyName, and CustomerID columns from the Customers table Figure 3.29: Building a SQL statement visually You can view the properties of a column in a table by clicking...
Ngày tải lên: 20/08/2013, 15:08
Creating a dataview using visual studio NET
... data stored in dataView1 to dataGrid1 and allows dataGrid1 to access any data stored in dataView1 Figure 13.2: Setting the Properties of dataGrid1 Select View ➣ Code and set the Form1() ... 14 // 15 InitializeComponent(); 16 17 // call the Fill() method of sqlDataAdapter1 18 // to populate dataSet11 with a DataTable named 19 // Customers 20 sqlDataAdapter1.Fill(dataSet11, "Customers"); ... } Compile and run your form by pressing Ctrl+F5 Figure 13.3 shows the running form Notice that the information in the form comes from the DataView you created Figure 13.3: The running form ...
Ngày tải lên: 20/08/2013, 16:48
Defining a relationship using visual studio NET
... (used to access the Northwind database), sqlDataAdapter1 (used to handle access to the Customers table), and sqlDataAdapter2 (used to handle access to the Orders table) These objects are shown ... tray beneath the form Next, you need a DataSet object that contains DataTable objects to store the rows from the Customers and Orders tables To create a DataSet object, click your blank form and ... this dialog in their default state Figure 12.5: The Generate Dataset dialog box Notice that a new DataSet is to be created, and the Customers and Orders tables are used in the new DataSet The...
Ngày tải lên: 20/08/2013, 16:48
Create a Report Using Crystal Reports Report Expert
... labels that are any size and any number of columns Standard The standard report is just that -a standard list report that lists your information It allows you to group and sort information, include ... their own rights Tabs Included in the Standard Report Wizard Included on the Standard Report Wizard are the following tabs: • • Data Specify the database and table that you will be using for this ... Crystal Reports includes wizards called Experts These Experts assist you in performing certain tasks, from creating a whole report to creating an individual formula for a field Experts are actually...
Ngày tải lên: 17/10/2013, 21:15
Customizing a Network Using the Registry phần 1
... undesirable, since all traffic can be redirected to a gateway that is not constantly monitored Because of this reason, set this parameter to EnablePMTUDiscovery (REG_DWORD data type) The default value ... (REG_DWORD data type) The default value (1) enables TCP/IP to switch to a secondary gateway if many connections experience problems However, in cases when you are under a DoS attack, such behavior ... this parameter enables TCP/IP to determine Maximum Transmission Unit (MTU) that can be transmitted to the system This feature is potentially dangerous, since it enables the attacker to bypass your...
Ngày tải lên: 07/11/2013, 08:15
Customizing a Network Using the Registry phần 2
... service are outlined in Table 8.3 Value name Table 8.3: W32Time Service Registry Values Data type Description Values AvoidTimeSyncOnWan REG_DWORD Synchronize with a computer that is at a different ... domain hierarchy or manually configured source Value name Table 8.3: W32Time Service Registry Values Data type Description Values [default] NTP = synchronize to manually configured source Adj ... service synchronizes = Always start the SNTP server Blank by defaut Sample data value: 192.4.41.40 = once a day 65535, every days 65534, every days 65533, every week (7 days) 65532, every 45 minutes...
Ngày tải lên: 07/11/2013, 08:15
Executing SQL Server Stored Procedures phần 1
... mySqlCommand.Parameters.Add( "@MyProductName", SqlDbType.NVarChar, 40).Value = "Widget"; mySqlCommand.Parameters.Add( "@MySupplierID", SqlDbType.Int).Value = 1; mySqlCommand.Parameters.Add( "@MyCategoryID", ... Values of any Output Parameters Your last step is to read the values of any output parameters AddProduct() used one output parameter named @MyProductID You read this returned value from the Value ... mySqlCommand.Parameters["@MyProductID"].Direction = ParameterDirection.Output; The other parameters required to call AddProduct() are: mySqlCommand.Parameters.Add( "@MyProductName", SqlDbType.NVarChar,...
Ngày tải lên: 07/11/2013, 10:15
Executing SQL Server Stored Procedures phần 2
... your DataReader object Close your DataReader object You must this before you can read any output parameters Read the values of any output parameters In the following example, you'll see a stored ... mySqlCommand.Parameters.Add( "@MyProductName", SqlDbType.NVarChar, 40).Value = "Widget"; mySqlCommand.Parameters.Add( "@MySupplierID", SqlDbType.Int).Value = 1; mySqlCommand.Parameters.Add( "@MyCategoryID", ... mySqlDataReader = mySqlCommand.ExecuteReader(); // step 4: read the rows using the DataReader object while (mySqlDataReader.Read()) { Console.WriteLine("mySqlDataReader[\" ProductName\"] = " + mySqlDataReader["ProductName"]);...
Ngày tải lên: 07/11/2013, 10:15
Debugging a SQL Server Stored Procedure
... pool rather than created, SQL debugging is not reestablished Changes to locals or parameter variables that are cached by the SQL interpreter are not automatically modified and there is no way to ... application must be established with the NET data provider for SQL Server before debugging a mixed-language application After that, you can open stored procedures and set breakpoints in the same way ... or unmanaged code, or into managed or unmanaged code from a stored procedure Set a breakpoint at entry point in the stored procedure or in the reentry point in the code as required Alternatively,...
Ngày tải lên: 07/11/2013, 13:15
Tài liệu Create a WAN Using SDSL Modems pptx
... Boedeker has been an active attorney and litigator for more than two decades JOSEPH L KASHI practices law in Soldotna, Alaska He has held various positions in the ABA’s Law Practice Management ... published data indicating that speed dropped dramatically as line distances increased Based on our actual field results, though, we can only assume the published performance estimates are very cautious ... complicates the installation and was not a significant concern When the remote segments were added, our network branches all came together as a single network The SDSL modems are transparent to various...
Ngày tải lên: 10/12/2013, 18:15
Tài liệu Q&A Session for Advanced Ball Screws 201: Troubleshooting for Design Engineers docx
... ways to improve the load capability of a ball screw? A: There are no magic ways to increase the load capacity of a standard ball screw A load carrying grease can help extend the life of an assembly ... regardless of lubricant used Q: Are there seals to retain the grease in the ball screw housing? A: Wipers are available as standard or optional on most ball nuts Q: Are Sealeze brushes are adequate? ... overall load rating will not change The load capacity of a ball screw is calculated based on the life of the ball bearing and the materials of construction Better materials, larger components, larger...
Ngày tải lên: 13/12/2013, 01:16
Tài liệu Accessing a Database Using Visual Studio .NET ppt
... connected to the database, you can view things such as the tables You can also retrieve and modify rows in the tables You can drill down to the tables in the database by clicking the Add icon in the ... Entering a SQL statement You can build SQL statements visually by clicking the Show Diagram button in the toolbar and selecting columns from the table, as shown in Figure 3.29 As you can see, ... selected the ContactName, CompanyName, and CustomerID columns from the Customers table Figure 3.29: Building a SQL statement visually You can view the properties of a column in a table by clicking...
Ngày tải lên: 14/12/2013, 13:15
Tài liệu Introducing Stored Procedures doc
... is the value displayed by the previous example if you run it You can of course also pass variables as parameters to a procedure The following example displays 79-the next ProductID: DECLARE @MyProductID ... DECLARE @MyProductName nvarchar(40) DECLARE @MySupplierID int DECLARE @MyCategoryID int DECLARE @MyQuantityPerUnit nvarchar(20) DECLARE @MyUnitPrice money DECLARE @MyUnitsInStock smallint DECLARE ... to view, modify, and delete procedures as well Tip You can also delete a procedure using the DROP PROCEDURE statement, and you can modify a procedure using the ALTER PROCEDURE statement In the...
Ngày tải lên: 14/12/2013, 13:15
Tài liệu Execute Parameterized Stored Procedures in ADO.NET ppt
... the DataReader are created The last task is to iterate through the data and add it to the display text box Private Sub btnView_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) ... code takes the connection and creates the command object The name of the stored procedure is passed, and the command type is specified, which is CommandType.StoredProcedure Next, parameters and ... OleDb.OleDbDataReader 11 12 Try 13 ' Specify the name of the stored procedure 14 ocmdCustHist.CommandType = CommandType.StoredProcedure 15 16 ' Specify the parameters 17 ocmdCustHist.Parameters.Add("@CustomerID",...
Ngày tải lên: 14/12/2013, 20:16
Tài liệu Updating a Database Using a DataSet doc
... Query and Save, respectively The next step is to create a DataAdapter class and bind it to the DataGridView control You will create the DataAdapter class by using the TableAdapter Configuration ... form and return to Visual Studio 2005 Performing Updates by Using a DataSet The changes made by using the DataGridView control are automatically copied back to the DataSet acting as the data source ... defined in a namespace called NorthwindDataSetTableAdapters (as are all the other TableAdapter classes for this DataSet) The second statement uses this object to fill the Products DataTable in the...
Ngày tải lên: 15/12/2013, 00:15
Tài liệu Troubleshooting a NIC Using the Ping Command doc
... Internet Instead, the loopback is an address that pings the NIC installed in the workstation you are currently using Type the command ping 127.0.0.1 Did you receive a reply back? Are the values for ... Step A workstation’s own NIC may be pinged by using its IP address, or something called the loopback address The address 127.0.0.1 is reserved as the loopback address and is not used ... time, and TTL the same as last time? If not, what has changed? Step If the technician can successfully ping the PC address, and the loopback, then the NIC and...
Ngày tải lên: 21/12/2013, 19:15
Ebook - How to Build a Service Using GT4
... Getting Started: Deploy a Service State Management Part I: Create Resources Lifetime Management Part I: Destroy Resources State Management Part II: Add a Resource Property Aggregating Resources: ... a Service Getting Started: Deploy a Service State Management Part I: Create Resources Lifetime Management Part I: Destroy Resources State Management Part II: Add a ... “make clean” April 2005 ant deploy – compiles java, installs into container How to Build a Service Using GT4 13 What Attendees Should Do Install GT4 and tutorial code Start the GT4 container...
Ngày tải lên: 07/01/2014, 01:19