Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Infopath Changing data before submiting to SQL

Posted on 2010-08-26
10
Medium Priority
?
312 Views
Last Modified: 2012-05-10
I have a form that submits data to  MS sql database.
The form has a repeating table with several fields.
This was working fine until I added a secondary data source to the same sql table.
This was to query some of the data fields.
Now when I submit the data to the main connection the data in my repeating table changers before it is put in the database
So I have two fields in my form that are start time and finish time
If I put 8:00 in my start time and 9:00 in my finish time then submit the data
I get the same data in my database.
But if I add another row to my repeating table with a start time of 10:00 and a finish time of 11:00
Then submit
The new row has a start time of 8:00 and a finish time of 9:00 the same as the first entry.
The data in the sql database is the same.
But if I clear the form before adding the new data this the data is correct.  
The form was working until I added a secondary connection to the database  
Any ideas as this is driving me mad
0
Comment
Question by:LeePrice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 15

Expert Comment

by:melli111
ID: 33533746
Check you text box in the repeating table for the start time and end time - do you have any default values?  OR do you have any rules that update these fields?  You can use the logic inspector and look through to see if anything else updates those particular fields.    (Tools > Logic Inspector...)
0
 

Author Comment

by:LeePrice
ID: 33533855
i have checked and nothing is being set.
i wasn't clear before in my question.
This is hapening with all the fields in the repeating table.
i just used the start time and finish times as an example
thanks for the prompt reply
0
 
LVL 15

Expert Comment

by:melli111
ID: 33533994
I'm working on re-producing this error.  What do you use the secondary datasource for?  i.e. what are you pulling in from it and are you storing any values from it in the new data?
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:LeePrice
ID: 33534182
i was using the secondry data source to pull the total meters cut for the past 7.
the sql query that i was using is

select Distinct("TotalMetersCut"),"FaceDate" from "dbo"."Face" as "Face" Where "FaceDate" > getdate()-7

just so you know im using infopath 2010 and ms sql 2005 on a windows 7 pc
i hope this helps.
0
 
LVL 15

Expert Comment

by:melli111
ID: 33534303
I haven't used infopath 2010 yet so hopefully there's no difference between versions that may be causing this.  would you mind sharing your form?  You can attach it to this post if you save a copy of it as a .txt; then I'll download it, save it and change it back to .xsn.  If you don't want to that's ok, it's just a little easier to diagnose looking at it
0
 

Author Comment

by:LeePrice
ID: 33534718
attached is the form saved as txt.

FaceReportV07.txt
0
 
LVL 15

Expert Comment

by:melli111
ID: 33534971
OK, I think I got it - it's hard for me to tell for sure since I can't test it (submit) since I obviously don't have the same database tables.  
At the header of your form you have the date, shift, and the face.  These are bound to the query fields in your main connection.  These query fields pull the information from the database to display in the data fields.  When you submit that first line of data is going into the database and those query fields see it in the query, setting the remaining datafields' values in the repeating table to the first line.  
Action:  Change the header fields at the top of your form either to the datafields (not query)  from your main connection or you can create fields for them in your HelperFields.
0
 

Author Comment

by:LeePrice
ID: 33535340
thank you for the reply. I have just tried your sugestion. I have remoed the header fields but I'm still getting the same problems. can you see nything else?
0
 
LVL 28

Accepted Solution

by:
clayfox earned 1000 total points
ID: 33535398
I have had this issue.

The data looks great in InfoPath right before submit.

Submit to SQL and the last record is repeated instead of the new record.

I think it is a bug.  The only way I have fixed it is to back track to my previous version before the last change and do it again.

I think something corrupts sometimes to cause this.

Hopefully you have a saved version from before the modification you made.

Save often and test often to make sure it has not broken. I have not had it happen twice but I have had it occur on a couple different forms and with both 2005 and 2008 databases and in InfoPath 2010 and 2007.
0
 

Author Comment

by:LeePrice
ID: 33540399
thats exactly the problem.

well thank you both for your help.
its not quite the answer i was looking for but at least i know i wasn't doing something worng.
Clayfox im going to take your advice and save and test more frequently!
thank you both.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Before you can digitally sign infopath forms, you must have a digital certificate. Microsoft Certificate Services will need to be enabled on a Windows Server 2008 to facilitate the creation and verification of the digital certifciates on the web ser…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question