﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » Enterprise Server - V1 » How do I?  » ConnectionString error</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 07:38:50 GMT</lastBuildDate><ttl>20</ttl><item><title>ConnectionString error</title><link>http://forum.strataframe.net/FindPost23766.aspx</link><description>Hi guys,&lt;br&gt;
&lt;br&gt;
When I  call the function below, I get a "Format of the initialization string does not conform to specification starting at index 0."  error at the line where I set the connection string. I'm trying to clear the SQL Server Tables on the server through ES.  Since it works on a local database, what do I need to change so it will play nice with ES?  Thanks.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Public Function ClearPPMTables(ByVal dbName As String) As Boolean&lt;br&gt;
&lt;br&gt;
        Using conn As New SqlConnection&lt;br&gt;
&lt;br&gt;
            conn.ConnectionString = MicroFour.StrataFrame.Data.DataLayer.DataSources(me.DataSourceKey).ConnectionString&lt;br&gt;
            conn.Open()&lt;br&gt;
&lt;br&gt;
            Using cmd As New SqlCommand&lt;br&gt;
                cmd.CommandType = CommandType.StoredProcedure&lt;br&gt;
                cmd.CommandText = "dbo.sp_ClearTables"&lt;br&gt;
                cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128)&lt;br&gt;
                cmd.Parameters("@dbname").Value = dbName.Trim&lt;br&gt;
                cmd.Connection = conn&lt;br&gt;
                Me.ExecuteNonQuery(cmd)&lt;br&gt;
&lt;br&gt;
            End Using&lt;br&gt;
        End Using&lt;br&gt;
    End Function</description><pubDate>Wed, 08 Jul 2009 08:47:19 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: ConnectionString error</title><link>http://forum.strataframe.net/FindPost23779.aspx</link><description>[quote]I figured, however, that this would allow you to add another one to your, "They shouldn't be allowed to use our framework, if:" list. [BigGrin] [/quote]&lt;br&gt;
&lt;br&gt;
LOL...the thought NEVER crossed my mind...we have all been there!  When you get in the heat of the battle sometimes you just resort to "getting the job done" and so I totally understand!</description><pubDate>Wed, 08 Jul 2009 08:47:19 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: ConnectionString error</title><link>http://forum.strataframe.net/FindPost23778.aspx</link><description>The reason why I didn't do it that way is because it makes too much sense.  Especially since I allready did it the correct way in the function right below it. :blush: &lt;br&gt;
&lt;br&gt;
I figured, however, that this would allow you to add another one to your, "They shouldn't be allowed to use our framework, if:" list. :D&lt;br&gt;
&lt;br&gt;
As always, thanks again.&lt;br&gt;
&lt;br&gt;
[codesnippet]    Public Function BackupDatabase(ByVal dbname As String) As Boolean&lt;br&gt;
&lt;br&gt;
        Using cmd As New SqlCommand()&lt;br&gt;
&lt;br&gt;
            cmd.CommandType = CommandType.StoredProcedure&lt;br&gt;
            cmd.CommandText = "dbo.BackupDatabase"&lt;br&gt;
            cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128)&lt;br&gt;
            cmd.Parameters("@dbname").Value = dbname.Trim&lt;br&gt;
&lt;br&gt;
            Me.ExecuteNonQuery(cmd)&lt;br&gt;
&lt;br&gt;
        End Using&lt;br&gt;
    End Function[/codesnippet]</description><pubDate>Wed, 08 Jul 2009 08:38:59 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: ConnectionString error</title><link>http://forum.strataframe.net/FindPost23773.aspx</link><description>Well, remember that the ES is actually where the connection string is..so you need to pass this logic over in the form of a query versus trying to create the connection local.  All query traffic is passed over to the ES and then executed server side.  So in this case, I am not sure why you are trying to set the connection yourself anyway.  From the looks of the code, it appears that this is within a BO anyway.  So there is no need to set the connection, just execute the query.&lt;br&gt;
&lt;br&gt;
[codesnippet]Public Function ClearPPMTables(ByVal dbName As String) As Boolean&lt;br&gt;
&lt;br&gt;
Using cmd As New SqlCommand&lt;br&gt;
cmd.CommandType = CommandType.StoredProcedure&lt;br&gt;
cmd.CommandText = "dbo.sp_ClearTables"&lt;br&gt;
cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128)&lt;br&gt;
cmd.Parameters("@dbname").Value = dbName.Trim&lt;br&gt;
Me.ExecuteNonQuery(cmd)&lt;br&gt;
&lt;br&gt;
End Using&lt;br&gt;
End Function [/codesnippet]</description><pubDate>Wed, 08 Jul 2009 07:33:37 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>