.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

The data source control failed to execute the insert command

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :SharePoint

In SharePoint Designer 2007 I'm trying to customize the edit form that you get when you create a list item in a SharePoint 2007 list (EditForm.aspx). I took the following steps:

1.       Open the site in SharePoint Designer 2007.

2.       Browse to the list and open the 'NewForm.aspx' web form.


View Complete Post

More Related Resource Links

The data source control failed to execute the insert command


Hi All,

I have create table in SQL 2005 and retrive its data in to sharepoint  with the help of Database connection option through Sharepoint Designer. When configuring the connection i have selected a custom quer with stored procedure option and from the dropdown option selected the insert stored procedure everything is ok.

Stored Procedure
CREATE PROCEDURE ChangeTable_insert

 @PROJECT varchar(50) ,

INSERT INTO [dbo].[ChangeTable]





i have created new aspx page in Sharepoint Designer from the datasource details-->Insert selected fields as-->selected new item form and saved this page.
When i opened this page in to browser and try to save data it gives an below error
Go back to site 
Error: "The data source control failed to execute the insert command.
 Troubleshoot issues with Windows SharePoint Services."

please help me. i have to save data to sql database through sharepoint

thanks in advance

"The data source control failed to execute the insert command." when inserting to sql table with tri



I have a data view web part that inserts a new record into a sql table. This works fine.

I have now needed to add a trigger to the sql table that sends an email when a new record is inserted (the code for which works fine) but now my insert fails with 'The data source control failed to execute the insert command.'.

If I disable the trigger the form works fine again.

Any ideas what could be causing this?


Excel Data Source SSIS AcquireConnection failed 0x80004005 unspecified error

Nuances of using Excel data sources with SSIS Your Development Machine Setup Needs Jet Drivers, available along with the default Office install so if you have Excel working fine locally, this is enough. Installing the "Office Data Connectivity Components" (download file name AccessDatabaseEngine.exe) as well as having Office installed corrupts the Jet Driver stack so that SSIS in VS 2008 cannot create the object to read the XLS file. You will see the title error "Unspecified Error" and "80004005" code. Resolution: Uninstall the Jet Engine pack on your development XP machine if you have Office. It will be listed as something like "Microsoft Access Database Engine (2010)". Run Office 200x setup with the Repair option and reboot. Try configuring the task in SSIS and it should be able to read the Sheet names again and columns.  Live Server (32-bit and 64-bit) Deploying your SSIS package to a server without Office 200x means it will not have the Jet Engine drivers to read XLS, XLSX files. You must install the 32-bit Office Data Connectivity Components - Jet Drivers mentioned above found here  (http://www.microsoft.com/downloads/details.aspx?familyid=7554f536-8c28-4598-9b72-ef94e038c891&displaylang=en). There are no 64-bit drivers; therefore regardless of 32 or 64-bit live environments, this step is the same. You shoul

"Logon failed. Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no def

When i attempt to fill my Crystal Report -named limitler.rpt and it is under the sub-folder Oraburslar of my project -, i get the following error; "ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. Error in File C:\DOCUME~1\KEMAL~1.ESM\LOCALS~1\Temp\limitler {148B6FE6-D5BE-4BC3-A13A-47CCCB79D78B}.rpt: Unable to connect: incorrect log on parameters." How can i handle this pro? Thanks in advance... Here is how i connect to database to fill the Crystal Report:string database = ConfigurationManager.AppSettings["Database"].ToString(); string password = ConfigurationManager.AppSettings["Password"].ToString();string username = ConfigurationManager.AppSettings["Username"].ToString(); string server = ConfigurationManager.AppSettings["Server"].ToString();ReportDocument report = new ReportDocument();report.Load(Server.MapPath("~/Oraburslar/limitler.rpt")); report.SetDatabaseLogon(username, password); CrystalReportViewer1.ReportSource = report; CrystalReportViewer1.BackColor = System.Drawing.Color.White;

How to insert data to Treeview control from database

I want to make a menu used treeview control.so I can get data from database,I want to see in treeview.My database: Tablename: Menu,Field: Id,ParentId,Title.How do see this table in treeviewExample:--Main menu1 -- id is 1,parent id is null        -- sub menu1 -- id is 3,parent id is 1        -- sub menu2 -- id is 4,parent id is 1--Main menu2 -- id is 2,parent id is null         -- sub menu1 -- id is 5,parent id is 2         -- sub menu2 -- id is 6,parent id is 2

How to set items from Select Command in Data Source to populate textboxes


I need to know how to get the  items from a Select Command in a Data Source to populate textboxes. For instance in the Select statement below I want to set the textbox for First Name equal to the item in the Select Command highlighted below:


 Protected Sub MHGrid_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MHGrid.SelectedIndexChanged
        Me.Table1.Visible = True

        Me.txtFirstName.Text = (1)

    End Sub


Binding a DVDropDown control to a XML data source


I'm having a heck of time figuring how to get my DVDropDown control to display items from the SoapDataSource (SOAP web service) or XmlDataSource (REST).


If I create a data view for the same data sources, I can see the data just fine, but when I go to Data Fields dialog, I can select the data source in the dropdown but in all cases, the two other dropdown to pick the value and display text are blank and there's nothing for me to select though I know there should be columns available for selection.


I've also tried manually coding those parameters, accounting for the possibility that I may need fully qualified XPath to get to the column itself but that causes an error.


What could I be missing?



Unable to drag data source to control to bind


I have a simple test application following the directions from http://msdn.microsoft.com/en-us/library/dd465159.aspx .  When I attempt to drag the data source onto the design surface I get the following error:

Cannot add the control to the design surface or bind to the control because the type TestApp.AdventureWorksEntities cannot be resolved.  Please try to build the project or add necessary assembly references.

The project as been built and the data source is in the same namespace.  I did a search for this error and the only hit I found was here, and mentioned Tools->Options->Extension Manager, 'Load per use extensions...'.  This option is checked.  I've tried unchecking and restarted with the same behavior.

Any ideas?


How to write Stored Procedure for Insert Data & Execute it in MS SQL?


How to write Stored Procedure for Insert Data & Execute it in MS SQL?

Initialization of the data source failed in Excel 2007 from As 2008R2


Environment: Win server 2003 , Office2007, SQL Server2003, PowerPivot for Excel

All the user do have access to connect the cube. am the admin user and i get the same error message.

"Initialization of the data source failed. Check the database or contact your database administrator. Make sure the external database is avaliable, and then try to operation again.

I have tried deleteing the data source and creating a new one.

Can any one help with this there are other fourms on this but i can't see a answer for it.


modify sql data source command in code behind


i had a requirement for dynamic sorting so i wanted to assign order by.. dynamically depending on what column is clicked for sorting

i tried to modify the sql data source command 

in ds selecting event

by using


but it doesnt work as it always picks up selectCommand specified in aspx page

LINQ data source control and db connection string


I have designed a few pages which use LINQ datasources and Gridviews to maintain data.

I have built a data layer which happily uses System.Web.Configuration.WebConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString

However, the LINQ data source controls use Settings.designer.vb MySettings class definition which is auto generated and doesn't except the above Connection string.

Any ideas?

Sharepoint Data Source Control

How can we get distinct records from sp list in spdatasource control using sharepoint designer?

Unit Testing Error - The unit test adapter failed to connect to the data source or to read the data


I'm using VSTS 2K8 and I've set up a Unit Test Project. In it, I have a test class with a method that does a simple assertion. I'm using an Excel 2007 spreadsheet as my data source.

My test method looks like this:

"Dsn=Excel Files;dbq=|DataDirectory|\\MyTestData.xlsx;defaultdir=C:\\TestData;driverid=1046;maxbuffersize=2048;pagetimeout=5",
public void State_Value_Is_Set()

Cannot create a connection to data source ... Login failed for user: BUT not for all reports!


SQL Server 2008 using Report Builder v2.0  (Microsoft SQL Server Reporting Services Version 10.0.2531.0)

We have several reporting service apps with many reports in each one. There is a set of 4 reports that all report on similar info (but grouped differently) that can be run by me and other network administrators but not any "regular" users. On these reports only, they are getting "Cannot create a connection to data source ... Login failed for user...". As I've said there are other reports that regular users can run just fine!? ALL reports use the same Shared Connection Data Source on the server that is set up as Windows Integrated Security. The Data Source's Security allows Domain Users to browse.  

I've uploaded a test report to SSRS whos SQL is "SELECT 'test' as testField" and that's it: and is connected to this same Data Source and users still get the Login Failed error... even tried creating and using a new Data Source that points to the same SQL Server DB to no avail. Examining the rdl's XML doesn't reveal anything either.

Reporting Server is a different machine than the SQL Server DB holding the data.

The only clue is that working reports were created a year before now.

DataReader Source Data Flow control not in the Toolbox of BIDS ???


I find this advice in the SSIS forum . . . but I can't find the DataReader Source in the Data Flow source items . . . nor do I seem to be able to 'Add Item' that time.

Advice appears to be I should use DataReader Source when pulling data from Oracle using ODBC e.g.:

"ODBC is supported in the data flow by the Data Reader source adapter. I think the original problem may have been that you were trying to use the Data Reader source with an ODBC connection manager.

To extract data from an ODBC source, try the following:

  • Add an ADO.Net Connection Manager.
  • Edit the Connection Manager editor and select the ODBC Data Provider
  • Configure the Connection Manager to use your DSN or connection string
  • Add a Data Flow Task to your package.
  • Add a Data Reader Source adapter to your data flow"

Any help getting the DataReader Source to appear in the BIDS toolbox appreciated.

Thank you and a Happy time with family tomorrow,



GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend