.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

add new items to sql server using infopath 2007

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

can someone help me with this adding new items using infopath 2007.

i have create a form based on sql database connection.

i have 2 tables that are related to each other. table A is the user table with the user name and id in it. table B is the vacation days table that has the days that the user went or will go on vacation.

in my form i have set 2 field with the user and the user id and a repeating section with the absence/vacation days in it.

when i go to preview the form and click on the "run query" both the fields and the repeating section are filled correctly. and if i click on insert item to insert a new item it submit fine to the database.

but what i need is that the user must fill a new form. when i click on the "new" button it cleared all the fields. but i dont want it to clear the username and the userid field.

i want the user to open a blank form with only his username and userid already filled in.

i know how to autopapulate those fields. but everytime i try to insert new absence dates. it gives me this error:

Violation of PRIMARY KEY constraint 'PK_USER'. Cannot insert duplicate key in object 'dbo.USER'.

another error i have got once was that i need to insert the 2 keys i have in the tables.

but i dont want that the user fill in the keys

can someone

View Complete Post

More Related Resource Links

Submtting Calendar items with variable date information via InfoPath 2007 form



I've seen several posts regarding submitting to a list using and InfoPath form which I am successfully able to do in limited form. (only passing a basic date value) My environment: MOSS 2007 Enterprise w/SP2, InfoPath 2007, SPD 2007.

I'm basically trying to recreate a calendar form with the same data elements (and some additional ones for a specific business requirement) as the standard calendar newform.aspx form. (start time, end time broken down by date, hour, minute and All day event)

I need the form users to be able to select the date and if it is not an All day event...be able to select the hours and minutes just like on the newform.aspx. (date picker control for date and drop downs for hour and minute selection)

On submit I then need to create the list item with the appropriate data passed via a workflow.

My Start Time has a validation rule to not allow dates prior to the current date (and it can't blank) The End Time has a validation rule to not allow dates prior to what is specified as the Start Time value. (Also can't be blank) When I attempt to include conditonal formatting to hide the hour and minute drop downs if 'All Day Event' is selected I get errors stating the fields can't be blank.

I also can't figure out how to pass the entire date/time values or the All Day Event to the list withou

The URL is not valid error while publishing InfoPath form to MOSS 2007 server

Hi All,   When I try to publish the form onto a SharePoint Team site it throws the error: The following URL is not valid : http://tcs037288:6543/sites/projectmanagement   I have checked the comaptibility, trust and everything looks fine. Also, I tried to upload this template from Central Admin but there it is failing with browser-compatibility errors.       Regards,

Getting error while retrieving data from sql server 2008 to infopath 2007 in sharepoint 2007

Hi, I have created an InfoPath form in InfoPath 2007. In this form I am getting data from SQL Server. To do this I have created data source for SQL Server 2008’s Tables. I have created 4 connections for 4 tables. When I am previewing this form from InfoPath Designer 2007, it is working. But when I am publishing this, it is giving me an error ‘Can not update content type’. If I skip this error then my form published but when I open this form from Share Point 2007. It gives me an error:   There has been an error while processing the form. Click Continue to resume filling out the form. You may want to check your form data for errors. Click Start Over to load a new copy of the form.   An error occurred accessing a data source. An entry has been added to the Windows event log of the server. Log ID: 6932 G. Goyal

move infopath forms from SP Portal Server 2003 to 2007


I am a newbie to SharePoint. Please let me know if I didn't explain my problem well...

We built the new SharePoint server 2007 on a different physcial box from the old server 2003. There are huge amount of InfoPath forms in form library on the old server. I was told that: to get these forms moved over to the new server 2007, we have to save the forms and re-publish to the new server one at a time. This will be really time consume and also loosing the attributes of the original forms, the date it was created and modified etc.

I would like to see if there is a way to move one form library at a time, and just copy the forms over; not publishing them again.

Many thanks!


How can I get a list of selected items from a multiple-selection box in Infopath 2007

I have an Infopath 2007 form with a multiple-selection box.  The form has a receive data connection to a Sharepoint custom list which shows software available to staff.  The form allows the user to select any number of items from the list of software.  I want to be able to show a summary list and more importantly print a summary of just the items from the list that were selected.  I want to be able to hand my IT person a list of the software that user needs installed.   I am trying to figure out how to get this summary list so it can be printed out.  Any help would be appreciated.
Renee Boyd

HttpContext.Items and Server.Transfer/Execute

The problem was basically that when a Server.Transfer call was applied the script container (and also various ClientScriptProxy script embedding routines) would potentially fail to load up the specified scripts.

Talk Back: Voice Response Workflows with Speech Server 2007


Speech Server 2007 lets you create sophisticated voice-response applications with Microsoft .NET Framework and Visual Studio tool integration. Here's how.

Michael Dunn

MSDN Magazine April 2008

Basic Instincts: Server-Side Generation of Word 2007 Docs


This month, Office Open XML, which allows ASP.NET and SharePoint developers to read, write, and generate Word, Excel, and PowerPoint documents on the server without running an Office desktop application there.

Ted Pattison

MSDN Magazine November 2006

SQL Server 2005: Jazz Up Your Data Using Custom Report Items In SQL Server Reporting Services


Custom report items in SQL Server 2005 Reporting Services address your needs for custom reports without the pain of doing it from scratch.

Teo Lachev

MSDN Magazine October 2006

InfoPath 2007: Designing Form Templates With The New Features Of InfoPath


InfoPath 2007 is an XML forms designer and editor, and a fully featured and integrated member of the Office family. This article takes a sneak peek at some of its new features.

Scott Roberts and Hagen Green

MSDN Magazine August 2006

How can Install Office 2007 on Windows server 2008 R2 64 bit machine in WSS 3.0

I have  64 bit machine  and Windows server 2008 R2 has installed. i have successfully install WSS 3.0  , but  when i tried to install  office 2007 ,  one  error  has  come  "OS is not compatible "  i thought  it was asking  for 64 bit office  2007   and i go through the  google and R&d find no 64 bit office is available ,  i have used   excel .dll in my custom code  so my problem is that   how can  install office 2007  on 64 bot OS 2008 r2  machine .  if anyone can help   me  , please let me know . thanks in advance

MOSS 2007 : I am looking for tutorial about how tu use infopath 2007 forms and to associate to them



I am quite new on sharepoint 2007,

i am at the moment looking for tutorial to help to understand better the concept of workflow you can associate with infopath 2007.

I would like to create a  form that the visitor of the website can fill and then submit.

once the form submitted i would like tto be able to store all the date picked up to the database sqlserver 2005 and then to be able to send a email to the administator to be kept inform  of that.

the 2 tutorial i found that i found interested are http://weblog.vb-tech.com/nick/archive/2007/02/25/2207.aspx and the microsoft one o.n the virtual lab.

So what i am looking for is any tutorial which can help me to be understand very well how to use the worklow with infopath or if you have as well some book to advice me for that i would be happy.


How to set rule only on form validation success InfoPath 2007



I'm a newbie to InfoPath 2007. I am creating a from without code. Is there a way to set a Rule to the Submit Button which will be triggered only in the case of Form validation success ? can we make use of the "Set condition" to setup a expression  in the Rule, for this purpose. Still i have no idea how to come up with an expression for such purpose. Can someone please explain.

Infopath 2007 print view in browser enabled form with Print button


Hi i create a  print view brower enabled form in Infopath 2007 with header and footer. In Infopath works fine. Margin was ok, header and footter to. But then i try to print this browser the margin, header and footer it changes to default setting of browser ? I try also create a print button in form with VS 2008 code, but method :

this.print(); not working.

It is possible to print the "print view" in browser as the same like in Infopath 2007? Does anyone have the code how to create a print button in C# on browser enabled form?

Issue in Infopath 2007 browser form - cascading dropdown using owssvr.dll filter view


Referring the below link, I created a cascading dropdown. The parent dropdown has sharepoint list as datasource and the child dropdown has xml datasource that points to owssvr.dll filter view. The cascading drop down works fine in preview but throws error after publishing as admin approved form - "form cannot run the specified query" exception when trying to execute xml datasource i.e., when a value is selected in parent dropdown. The security is 'Full Trust". In the event viewer the error message states "401 unauthorised" for the user a/c. the xml data source is an approved udcx file and in central admin, have enabled cross domain for infopath service. I have tried different solution provided in tech forums but issue still exists. Not sure whether Im missing something. Can someone guide me in fixing this issue?

Link Reffered:



cascading functionality in infopath 2007


Hello ,

I have a few drop downs in my browser based infopath 2007 forms and they  have cascading functioanlity ie they get filtered data..for filtering i qam using a web service..now the issue is that say i have 4 drop downs and for getting the fourt drop down's value the web service takes as input the second and the third's drop down value..now what is happening is that if based on the second drop down value if there is no value returned for third drop down then i cannot get to fourt drop down's value whichi should as it has value irrespective of whether the third drop down has some value or not....this is only the issue when i access the form in browser ..when i access it through the client infopath then it's working good...but in browser form the event is not firing when i select the emty value in third drop down...

Can somebody please tell me what to do..


VS Studio WorkFlow Failed on Start in MOSS 2007 ON Windows Server 2008 64 Bit


I have created a sequential sharepoint workflow in WSP Builder in my Sharepoint Server and Deployed it.

But the workflows says Failed on start and retrying ans stops there forever says couldn't start the workflow.

I repaired .NET Framework 3.5sp1 installed

 tried this

 1. I tried again, in C Prompt:  Lodctr "c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini"  it says initiation file cannot be found

2   i again tried this C prompt Lodctr /R "c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini"

it says reloaded  from the system restored

i am still getting the same error.

When i manually go to my  C:\Windows\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation i can see a folder for SQL that's it nothing more than that..

I dont know what is happening i am trying it from 2 days and still no solution.

any ideas would be real great help for me.

My system is 64 bit , Window server 2008, MOSS SP2, Visual Studio 2008 Version 9.0.30729.

.Net Framework 3.5 sp1

and WSP builder the one from Codeplex for 64 bit machines

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