Copy and modify a data source

There are certain situations in which you may want or need to copy a data source connection before you modify it, including:

  • When you are working with Microsoft SharePoint lists and libraries, and you want to create a custom query.

    The data source connection for SharePoint lists and libraries displays data from a default query that cannot be modified. However, if you copy a data source connection for a SharePoint list or library, you can then create a custom query.

  • When you are working with a database, and you want to create several data source queries that are based on the same source data.

You can also copy and modify other data source connections in the Data Source Library. When you click Copy and Modify, you create a copy of the data source connection. You can then modify the copy by using options in the Data Source Properties dialog box.

You can modify the query for SQL-based data sources, such as SharePoint lists and libraries and database connections. For other data source connections, there is no query to modify. However, you can modify other properties for those data source connections.

What do you want to do?

Copy and modify a SharePoint list or library

Copy and modify a database connection

Copy and modify an XML file

Copy and modify a server-side script

Copy and modify an XML Web service

Copy and modify a linked data source

Copy and modify a SharePoint list or library

SharePoint lists and libraries that appear in the Data Source Library are connections to the original data, and they display the results of a query on that data. Unlike with queries for other data sources in the Data Source Library, you cannot modify queries for data sources that are automatically created for SharePoint lists and libraries. You can, however, copy a connection to a SharePoint list or library and then create a custom query to apply to the list or library in order to display the exact data that you want.

The following steps show you how to copy a data source connection and then change the name, description, and keywords for that data source. For more information about how to modify the query for a data source, see the article Create a data source query.

  1. If the Data Source Library isn't visible, on the Task Panes menu, click Data Source Library.

  2. In the Data Source Library task pane, click the SharePoint list or library that you want to copy and then modify, and then click Copy and Modify.

    The Data Source Properties dialog box appears.

  3. On the General tab, in the Name box, type a name for your new data source.

    Note: If you don't type a new name for the copy of the data source, the name will be the same as that of the original data source, but with _copy(1) appended. For example, if you copy the Announcements data source connection but don't type a new name, the name of the new data source will be Announcements_copy(1).

  4. In the Description box, type a description for your new data source.

  5. In the Keywords box, type any keywords that you want.

You can now specify a query for your new list or library. For more information about creating a query, see the article Create a data source query.

Top of Page

Copy and modify a database connection

You can modify a query for a database connection both quickly and easily. However, if you have several queries, all of which you use on a regular basis, you may find it convenient to save each individual query as a separate data source.

For example, Northwind Traders, a gourmet food company, tracks their products in an SQL database. The default query on the database displays all of the products that Northwind Traders has ever ordered. A team member suggests that another query be created to display only those products that have been discontinued. This result can be easily accomplished by copying the first data source query, modifying the query so that it displays only the discontinued items, and then saving the modified query under a new name as a separate database connection in the Data Source Library.

The following steps show you how to copy the data source and then change the name, description, and keywords for that data source. For more information about how to modify the query for a data source, see the article Create a data source query.

  1. If the Data Source Library isn't visible, on the Task Panes menu, click Data Source Library.

  2. In the Data Source Library task pane, click the database connection that you want to copy and then modify, and then click Copy and Modify.

    The Data Source Properties dialog box appears.

  3. On the General tab, in the Name box, type a name for your new data source.

    Note: If you don't type a new name for the data source, the name will be the same as the previous item with _copy(1) appended to it. For example, if you copy the Products database but don't type a new name, the name of the new data source will be Products_copy(1).

  4. In the Description box, type a description for your new data source.

  5. In the Keywords box, type any keywords that you want.

You can now specify a query for your new database connection. For more information about creating a query, see the article Create a data source query.

Top of Page

Copy and modify an XML file

As with SharePoint lists and libraries, you cannot modify the data source connections that are automatically created for local XML files. However, you can copy and modify local XML files in order to modify the name of the data source, add a description, or add keywords. The name, description, and keywords for an external XML file can be modified without first copying the data source.

  1. If the Data Source Library isn't visible, on the Task Panes menu, click Data Source Library.

  2. In the Data Source Library task pane, click the XML file that you want to copy and then modify, and then click Copy and Modify.

    The Data Source Properties dialog box appears.

  3. On the General tab, in the Name box, type a name for your new data source.

    Note: If you don't type a new name for the data source, the name will be the same as the previous item with _copy(1) appended to it. For example, if you copy the Products XML file but don't type a new name, the name of the new data source will be Products_copy(1).

  4. In the Description box, type a description for your new data source.

  5. In the Keywords box, type any keywords that you want.

Top of Page

Copy and modify a server-side script

Copying and modifying a connection to a server-side script might be helpful if you need to connect to that same server script but with different parameter values.

  1. If the Data Source Library isn't visible, on the Task Panes menu, click Data Source Library.

  2. In the Data Source Library task pane, click the XML file that you want to copy and then modify, and then click Copy and Modify.

    The Data Source Properties dialog box appears.

  3. On the General tab, in the Name box, type a name for your new data source.

    Note: If you don't type a new name for the data source, the name will be the same as the previous item with _copy(1) appended to it. For example, if you copy the file Rss.aspx on the www.gotdotnet.com server-side script but don't type a new name, the name of the new data source will be Rss.aspx on www.gotdotnet.com_copy(1).

  4. In the Description box, type a description for your new data source.

  5. In the Keywords box, type any keywords that you want.

  6. On the Source tab, in the Add or Modify Parameters box, do one of the following:

    • Click Add.

    • Click the parameter that you want to modify, and then click Modify.

  7. In the Parameter box, in the Name box, type a name for the new or modified parameter.

  8. In the Default Value box, type a default value for the new or modified parameter.

    Note: If the server-side script uses a parameter that was entered by a user who was visiting the site, select the The value of this parameter can be set via a Web Part connection check box.

Top of Page

Copy and modify an XML Web service

Copying and modifying an XML Web service might be helpful if you need to connect to the same Web service but want to use either different methods or different parameter values.

  1. If the Data Source Library isn't visible, on the Task Panes menu, click Data Source Library.

  2. In the Data Source Library task pane, click the XML file that you want to copy and then modify, and then click Copy and Modify.

    The Data Source Properties dialog box appears.

  3. On the General tab, in the Name box, type a name for your new data source.

    Note: If you don't type a new name for the data source, the name will be the same as the previous item with _copy(1) appended to it. For example, if you copy the Webs on Northwind Web service but don't type a new name, the name of the new data source will be Webs on Northwind_copy(1).

  4. In the Description box, type a description for your new data source.

  5. In the Keywords box, type any keywords that you want.

  6. On the Source tab, in the Parameters box, click the parameter that you want to modify, and then click Modify.

  7. In the Parameter box, type the parameter that you want to use.

    Note: If the Web service uses a parameter that was entered by a user who was visiting the site, select the The value of this parameter can be set via a Web Part connection check box.

Top of Page

Copy and modify a linked data source

Copying and modifying a linked data source may be helpful if the linked data source is composed of database connections and you want to create a copy of the first linked database connection in order to modify the query.

The following steps show you how to copy the data source and then change the name, description, and keywords for that data source. For more information about how to modify the query for a data source, see the article Create a data source query.

  1. If the Data Source Library isn't visible, on the Task Panes menu, click Data Source Library.

  2. In the Data Source Library task pane, click the linked data source that you want to copy and then modify, and then click Copy and Modify.

    The Data Source Properties dialog box appears.

  3. On the General tab, in the Name box, type a name for your new data source.

    Note: Unlike other data source connections, if you don't type a new name for the data source, the name will be the same as the previous item.

  4. In the Description box, type a description for your new data source.

  5. In the Keywords box, type any keywords that you want.

You can now specify a query for your new database connection. For more information about creating a query, see the article Create a data source query.

Top of Page

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×