Skip to content


Claculated field runtime error

Adriaan Davel asked 8 years ago
Hi, My calculated field validates correctly, but when I run the map I get the following error: “Format of the initialization string does not conform to specification starting at index 0”, I suspect that it has to do with the default connection I’m using, I have checked, it does exist. Please help, here’s my code: string locnCode = string.Empty; using (SqlConnection con = new SqlConnection(“_SQLDEF_GP_BAKERIES”)) { con.Open(); var cmd = new SqlCommand(@”SELECT TOP 1 ‘S’ + RIGHT(INTERID, 3) FROM PF000.dbo.PF_RM_Cust_Branch_MSTR WITH (NOLOCK) WHERE CUSTNMBR = ‘_CUSTNMBR’ ORDER BY DEFLTBRNCH DESC”, con); var locn = cmd.ExecuteScalar(); if (locn != null) locnCode = locn.ToString(); con.Close(); } return locnCode;
Best Answer
lorren answered 8 years ago
Actually Adriaan you need to remove the double quotes from your "_SQLDEF_GP_BAKERIES" so it is the actual connection name _SQLDEF_GP_BAKERIES.

If you would like to submit an answer or comment, please sign in to the eOne portal.