Hi,
I'm having some trouble while using the ExecuteActionQuery. I'm trying to set to SET IDENTITY_INSERT [CustomerInfo] ON but I'm getting the error "No Connection Present" which is strange because a normal insert further in the code is working fine.
What is the reason for this error (What am I doing wrong) ?
OS: Win7
Framework: C# .NET 3.5
DB: SQL 2008
LLBL version 2.0
Following code executed:
StringBuilder queryBuilder = new StringBuilder();
queryBuilder.Append(string.Format("USE {0} ", localDataAdapter.CatalogNameToUse));
queryBuilder.Append(string.Format("SET IDENTITY_INSERT [{0}] ON ", "CustomerInfo"));
queryBuilder.AppendLine("");
SqlCommand commandToUse = new SqlCommand(queryBuilder.ToString());
commandToUse.CommandType = CommandType.Text;
localDataAdapter.ExecuteActionQuery(new ActionQuery(commandToUse));
Cheers,
Andre