I wrote a snippet , but c# snippet code writes half of the.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>MySql ExecuteNonQuery</Title>
<Shortcut>psql_n</Shortcut>
<Description>ExecuteNonQuery</Description>
<Author>yhackup Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="csharp"><![CDATA[
try
{
using (MySqlCommand command = new MySqlCommand("SELECT * ct FROM arac_shadow WHERE heskod = @heskod ;", CreateConnection()))
{
command.Parameters.AddWithValue("@heskod", "");
if (command.Connection.State != System.Data.ConnectionState.Open)
command.Connection.Open();
command.ExecuteNonQuery();
command.Connection.Close();
command.Connection.ClearAllPoolsAsync();
}
}
catch (MySqlException ex)
{
throw new Exception($"{MethodBase.GetCurrentMethod().Name}.MySqlException : {ex.Message}");
}
catch (SocketException ex)
{
throw new Exception($"{MethodBase.GetCurrentMethod().Name}.SocketException : {ex.Message}");
}
catch (Exception ex)
{
throw new Exception($"{MethodBase.GetCurrentMethod().Name} : {ex.Message}");
}
]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
but if i write the exception parts like this it's ok
catch (MySqlException ex)
{
throw new Exception(ex.Message);
}
catch (SocketException ex)
{
throw new Exception(ex.Message);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
i couldn't understand what the problem was , If it was $ or { characters, it wouldn't be able to write the first line, I wonder what am I doing wrong?