Adding Employee's with E-connect 9

I am having some trouble adding employe's using Econnect 9. I recieve a 
"system error" which doesn't really lead me to any answers as to why 
I am having this issue. I was able to add customers and Sales Order 
transactions without a hitch. Here is a copy of both the error message as 
well as the code I am testing with. hopefully somebody can point me in the 
right direction.

Thanks

Error message
System.Data.SqlClient.SqlException was unhandled
  Class=16
  ErrorCode=-2146232060
  LineNumber=0
  Message="System error."
  Number=201
  Procedure="taCreateEmployee"
  Source=".Net SqlClient Data Provider"
  State=4
  StackTrace:
    Server stack trace: 
       at 
Microsoft.GreatPlains.eConnect.eConnectMethods.eConnect_EntryPoint(String 
ConnectionString, ConnectionStringType ConnectionType, String sXML, 
SchemaValidationType ValidationType, String eConnectSchema)
       at 
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase 
mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, 
Object[]& outArgs)
       at 
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
    Exception rethrown at [0]: 
       at 
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage 
reqMsg, IMessage retMsg)
       at 
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, 
Int32 type)
       at 
Microsoft.GreatPlains.eConnect.eConnectMethods.eConnect_EntryPoint(String 
ConnectionString, ConnectionStringType ConnectionType, String sXML, 
SchemaValidationType ValidationType, String eConnectSchema)
       at GP.Employee.Main(DataSet ds) in C:\Branch Office\Great 
Plains\GP\Class1.vb:line 431
       at Branch_Office.Activity.Button5_Click(Object sender, EventArgs e) 
in C:\Branch Office\Branch Office\User Controls\Activity.vb:line 52
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons 
button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at 
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, 
Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at 
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 
dwComponentID, Int32 reason, Int32 pvLoopData)
       at 
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 
reason, ApplicationContext context)
       at 
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, 
ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at 
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at 
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at 
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at Branch_Office.My.MyApplication.Main(String[] Args) in 
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence 
assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext 
executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()


Public Class Employee
    Public Shared Sub Main(ByVal ds As DataSet)
        Dim ClsEmployee As New Employee
        Dim OeConn As New eConnectMethods
        Dim sEmployeeDocument As String
        Dim bStatus As Boolean
        Dim sConnectionString As String


        ClsEmployee.SerializeEmployeeObject("Employee.xml", ds)
        Dim xmldoc As New Xml.XmlDocument
        xmldoc.Load("Employee.xml")
        sEmployeeDocument = xmldoc.OuterXml
        'Integrated Security is required. Integrated security=SSPI
        sConnectionString = "Integrated Security=SSPI;Persist Security 
Info=False;Initial Catalog=TWO;Data Source=Apollo\sql2005"
       
        Try
            bStatus = OeConn.eConnect_EntryPoint(sConnectionString, 
EnumTypes.ConnectionStringType.SqlClient, sEmployeeDocument, 
EnumTypes.SchemaValidationType.None)
        Catch exc As eConnectException
            Console.Write(exc.ToString)
        Finally
            Console.Write(bStatus.ToString)
            OeConn.Dispose()
        End Try

    End Sub
    Public Sub SerializeEmployeeObject(ByVal filename As String, ByVal ds As 
DataSet)

        Try
            Dim Oserializer As New XmlSerializer(GetType(eConnectType))
            Dim eConnect As New eConnectType
            Dim n As Integer = 0

            For Each dr As DataRow In ds.Tables("Employee").Rows
                Dim employee As New taCreateEmployee
                Dim employeetype As New UPRCreateEmployeeType
                With employee
                    .EMPLOYID = dr("emssn")
                    .FRSTNAME = dr("emfnam")
                    .LASTNAME = dr("emlnam")
                    .ADRSCODE = "PRIMARY"
                    .ADDRESS1 = dr("Emaddr")
                    .CITY = dr("emcity")
                    .STATE = dr("emstat")
                    .ZIPCODE = dr("emzipc")
                    .SOCSCNUM = dr("emssn")
                    .DEPRTMNT = dr("emactid")
                    .JOBTITLE = "TEMP"
                    .STRTDATE = dr("emfrstwrkd")
                    .SUTASTAT = dr("emactid").ToString.Substring(0, 2)
                    If dr("emw4status") = "M" Then
                        .MARITALSTATUS = 1
                    Else
                        .MARITALSTATUS = 2
                    End If

                End With

                employeetype.taCreateEmployee = employee
                ReDim Preserve eConnect.UPRCreateEmployeeType(n)
                eConnect.UPRCreateEmployeeType(n) = employeetype
                n += 1
            Next
            Dim fs As New FileStream(filename, FileMode.Create)
            Dim writer As New XmlTextWriter(fs, New UTF8Encoding)
            'Serialize using the XmlTextWriter.
            Oserializer.Serialize(writer, eConnect)
            writer.Close()

        Catch ex As System.Exception
            Console.Write(ex.ToString)
        End Try

    End Sub

End Class

0
PaulC (24)
4/12/2006 3:35:03 PM
greatplains 29623 articles. 6 followers. Follow

0 Replies
351 Views

Similar Articles

[PageSpeed] 17

Reply:

Similar Artilces:

Automate a macros when data in a cell changes (e.g.when using quer
Is there any way that a macro can be activated when the data of a specific cell changes? I assigned a macro to a "check box" button from the Tool Bar "Forms", and used the "cell link" from the "check box" properties, so when the data changes in the cell linked the "check box" is marked and the macro will start. So far, the "check box" gets marked when data changes but the macro doesn't start. The only way the macro starts is when I click in the "check box". Maybe you could use a worksheet event that will fire ...

E-Mail looses formatting
When I e-mail my newsletter, some of the recipient's copy has lost its formatting and the pages do not display correct. How can I fix that? The general wisdom here suggests outputting the newsletter as a PDF and attaching it to the email. There is no guarantee that your recipients will have HTML enabled for email, and PDF ensures that your formatting remains intact. There are a number of freeware PDF makers that install as print drivers; I use pdf995 on a regular basis. Bruce "W. Guy Delaney" wrote: > When I e-mail my newsletter, some of the recipient's copy h...

Sorting numbers into ranges i.e 0-1000,1001-2000 and getting count
Please help, I need to sort the following type cost apple 800 banana 1000 cherry 1500 banana 1050 banana 600 cherry 2500 apple 0 so that it sorts by type and then does count between ranges 0-1000 1001-2000, 2001-3000 i.e type 0-1000 1001-2000 2001-3000 apple banana "with a count here " cherry thanks mik -- Message posted from http://www.ExcelForum.com Hi one way: 1. Add a helper column to show your type. e.g. enter the following in column C / cell C1: =MAX(INT((B1-1)/1000),0)*1000 & " - " & (MAX(INT((B1-1)/1000),0)+1)*1000 and ...

Name change in AD leaves mailbox inaccessable...
After a users name is changed in Active Directory the user cannot connect to the mailbox thru Outlook Express 6. The user can access the mailbox through Outlook web access. Everytime the user tries with Outlook express it comes back with cannot authenticate username or password. Use full e-mail address as username. "Tim" <anonymous@discussions.microsoft.com> wrote in message news:17aa601c41e3e$d1f97a10$a601280a@phx.gbl... > After a users name is changed in Active Directory the > user cannot connect to the mailbox thru Outlook Express > 6. The user can access ...

column is added up by original figure not after rounding up
Microsoft Excel 2003 my format is multiplying cell by 0.245 the system automatically rounds up to the nearest unit (because i am using currency) When l total the whole column it adds by the original three digit and not the rounded up figure. Which means by totals are incorrect Change your formula to: =ROUND(A1*0.245,2) which will round to 2 decimal places (cents, or pence etc), or: =ROUNDUP(A1*0.245,0) if you really want to round up to units (dollars, pounds etc), Your total will now reflect what is on screen. Hope this helps. Pete Gwen wrote: > Microsoft Excel 2003 > > m...

Replicated AD in CRM
Hi, We have a potential client but need to clarify somthing. This company has a branch overseas, and another here in Melbourne Australia. Their AD is based in the overseas branch, the AD here is replicated with the one overseas. The overseas branch has Sieble and the Melbourne branch is wanting to install the Microsoft CRM. How will this work with the AD being replicated? When we do the install will we need to do anything with the AD in the overseas branch? Any help muchly appreciated. Thanks. Can you clarity your domain structure. Does the overseas branch use the same domain as the...

e-mail name vs. account name???
I just set up a new Exchange Server2003 SP2 on an existing Windows 2000 Server AD domain. Two of the users are using generic account names (i.e. associate and notebook902). These are real people named Jessica and Kathleen. E-mail addresses have been created on their accounts using their real names (i.e. jessica@domain.com and Kathleen@domain.com). Their e-mail is working fine. They receive e-mail that is sent to jessica@domain.com but when they send e-mail it shows as from associate@domain.com. How do I fix it so sent e-mail shows coming from e-mailaddress@domain.com rather than a...

Deleting links to Access when e-mailing workbook
Goodmorning, I have a large excel based application which uses links back to an Access DB to refresh/store all new data. When e- mailing this workbook to end users several messages appear asking about links etc. Is there a way to ensure the users don't get these messages when I email the workbook to them? In other words, I need the workbook to be a stand alone app, without looking for links back to the database. As my directors are PC illiterate I have to make things as easy as possible for them. Any urgent help would be fantastic. Jeff Tillack Information Resource Officer Inform...

Loop through email address list to send e-mails
Hi Every one, Following is a code that prints out weekly individual task lists from a master Critical Path. The code first creates a list of unique individuals on a temporary page, -then filter my critical path in a Column called "Next week" to only show action requiring follow-up on following week. -then prints-out a list of individuals who will receive task lists, -and finaly loops through alll values in "MyUniqueRng" to filter and print out the list name by name. What I would like to do, is instead of Printing-out these individuals task lists, sending them by ...

e-mial Poll
How can i create a Poll in the outlook and send it to some users; i want to insert a poll in my new Mail Message!? thank you, Shaheens <shaheens@gmail.com> wrote: > How can i create a Poll in the outlook and send it to some users; i > want to insert a poll in my new Mail Message!? Start Outlook and use Help to find the "Use voting buttons" topic. -- Brian Tillman Thank you Brian, i follow what the Help is saying but it doesn't work !! Am using Microsoft Exchange Server account and i couldn't find the Use voting buttons check box in Options !! Brian Till...

Autofilter #9
Hello Excellers, I would like to apply an autofilter to multiple worksheets, the criteria for the sheets are all the same. There are 3 sheets that don't need to have an autofilter. How can i realise this. Do i have to hide the sheets that don't need a autofilter and how do i apply the filter to the other sheets. Thanks, Reijer I can only imagine that this would best be done one at a time by Macro, and the filtered results copied from all the sheets over to one new sheet for analysis. Vaya con Dios, Chuck, CABGx3 "Reijer" <dito2000@quicknet.nl> wrote in mes...

Can Exchange 2003 server host multiple AD domains email
I have two domains that share a trust. One domain has a 2003 Exchange server. I would like this email server to host mail for the trusted domain also. Can the Exchange server host mail for both domains. -- bltmayo I'm assuming you are talking about domains as in "Active Directory" and not SMTP. Are these two domains in the same AD forest? If so, yes, easily. Run SETUP /DOMAINPREP on the other domain, then create an additional RUS in your Exchange System Manager that points to a DC in the other domain. If it is a separate domain, you can still do this, but you will nee...

Entourage connects to exchange through Airport only
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: Exchange Entourage connects to the exchange server only through my wireless connection, but when I switch to an ethernet cable, exchange goes offline. The weird thing is that my ethernet connection is good for internet and connecting with my corporate network, but not for exchange server. In the other hand, Airport connection is good only for internet and exchange server but I connect to my corporate network through it because it is a guest connection. <br><br>Can anybody could help me...

send e-mail to address inside of the office but receive outside
Hi all, I have Exchange 2000, using pop server from my ISP. When i send a e-mail do the clients of DOMAIN they receive my e-mails corretly and there are the comercial people that don't receive e-mail's. How can I send a E-MAIL to the domain of this person in a domain and make that e-mail come out to my ISP server and after that the comercial go and pick his e-mails to your outlook from pop server. Can some help me. -- Thanks , Pedro That's very difficult to understand. but i assume you are having trouble delivering mail to domains outside of your company. You need to ens...

Strategy for Saving E-mails?
I would appreciate being pointed to sources that discuss strategies for saving and being able to locate emails that I send and receive. In Word, for example, I create folders and sub-folders to store correspondence for individual clients and different matters pertaining to that client. In Outlook 2003 the e-mails are saved as an overall part of the single file. I know I can create separate folders, but I am curious as to the best thinking on how to accomplish the goal of saving and finding. Is there a way, for example, to co-ordinate the folder used in Word and that used in Outlook 2003. Ch...

Adding Title to Secondary Axis Office 2003
I am working on a chart with a secondary axis. Can you please tell me how to put a title on the secondary axis? Thank you in advance for your help. Hi, Once you have data on a secondary axis you can use, Right click chart > Chart Options > Titles. Enter text in appropriate box. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "C Kreig" <CKreig@discussions.microsoft.com> wrote in message news:A92A685C-9E39-4F88-9F67-5038B0289ADE@microsoft.com... >I am working on a chart with a secondary axis. Can you please tell me how >to > put ...

How can I get auto sum of column when new figures are added
I have put in formula to total a column of figures, it has empty cells for new items to be entered as they occur. It used to total in new items automatically, now it will not total in new items. It is a Monthly spreadsheet. I used" create a copy "to make blank copies to use for following months. I made changes to existing sheets as I needed to by using CTRL key and clicked on each future month. this may be why it will not total as new figures are added. Depends how you set it up. If you have the totals on row 1, ie =SUM(A2:A100) and when adding a ro put the cursor on row 2...

Junk E-mail folder #2
i am using Windows Vista Buisness and Small Buisness Office 2007 and i cannot get the junk folder to work correctly. what ever i do, it still recieves emails from people i have in my address book and treats them as junk. i have even re-installed office to no effect. i asume there is a file i need to delete as well as the registry keys relating to the junk email folder before re-installing. Can any one point me in the right direction? If a message ends up in your Junk Email folder and you deem that it shouldn't have, all you need to do is add that sender to your Safe Senders list...

Adding a Field Name from Table/Query to Excel Export File
What I have is an export file to excel which I am able to do successfully using an OutputTo macro: Object Type: Query Object Name: ZZZ_Executive_Summary Output Format: Miscrosoft Excel 97-2003 (*.xls) Output File: "C:\ES\" & Format(Date(),"mm-dd-yyyy") & " Executive Summary. xls" What I would like to do is add the branch name into the file name. The field in the query is simply "Branch" When I try something like &[Branch]& or (query name/field) >> &ES!Branch& or &[ES].[Branch]&, etc... no matter what I...

Cannot receive e-mail mailed to myself
Recently my home computer crashed. I restored the operating system and all program files from an image backup. Since then, when I e-mail to or from my office the sending computer gets the e-mails but the receiving computer gets nothing. Any help for that? What version of Outlook? What kind of mail server? (POP? IMAP? Exchange?). When you say "the sending computer gets the e-mails" do you mean they appear in the Inbox as if newly received? -- -Ben- Ben M. Schorr, MVP Roland Schorr & Tower http://www.rolandschorr.com http://www.officeforlawyers.com Author - The Lawyer&...

Dynamics 9 GP
I am looking to retool my server/application topology for some upcoming application launches and it has gotten me to think of how to treat GP/Dynamics. We have GP7 right now thanks to a 3rd party add-on that won't support 9 for a couple more months, and that server houses our SQL2000 db for GP and has a GP client on it, and that is all. 25 or so concurrent users with other customizations and now XML/Web Services tied into the mix. Is this overkill or should the GP db server stand on it's own? How big are your databases? How much are they growing? What type of data entry are you...

Adding deposit to Subtotal???
Recently posted a transaction for a customer in GP 8.0. The customer's balance on their Card ADDED the deposit to the subtotal on the invoice. So instead of showing the correct A/R of $200, it shows they owe $400. The invoice was for $300 with a $100 deposit. (Don't worry, we didnt' enter a negative deposit. If that's possible anyways). The actual invoice and distribution accts are correct as is the G/L. The problem only shows in the Customer's card and the A/R Trial Balance. Any help is appreciated. Thanks so much!!! ...

Missing Outlook 2003 E-Mail
I have a user who reported a strange problem. She is missing e-mail from her SENT ITEMS folder. The range is from some time in 2003 to some time in 2004. She has sent items from before, and after that time period. She simply seems to be missing all emails from that particular date range. Autoarchive Settings: Run Autoarchive every 14 days - checked Prompt before autoarchive runs - checked Delete Expired items - checked archive or delete old items - checked show archive folder in folder list - checked Clean out items older than 6 months Move old items to "path" - checked Can...

Adding ACT! address book to Outlook 2002
When I tried to add another address book to Outlook it didn't give me the option of ACT!. How do I get ACT! added to the list? Marlo <marlo@parasolawnings.com> wrote: > When I tried to add another address book to Outlook it > didn't give me the option of ACT!. How do I get ACT! added > to the list? File>Import and Export>Inport from another program or file. Select ACT! -- Brian Tillman ...

Connecting lines to shapes
Hi, I am new to Visio 2003 and am trying to draw a line between two shapes which will move whenever the two shapes move. If I draw my line using the default connection points that come with my shape the line sticks, but when I add my own connections points to the shapes and draw a line between the two new connection points, the line only glues to the first connection point. I have both snap and glue turned on and glue to guides and connection points and snap is set to the default settings. Am I missing something? Thanks for any help. Kylie On common problem is that when adding your...