Running SqlCmd utility using C# this way :
// Calls the sqlcmd
ProcessStartInfo info = new ProcessStartInfo(
"sqlcmd",
@" -S VDSS218 -i D:\Ravi\Blank_Database_Creation_script.sql");
info.UseShellExecute = false;
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
info.RedirectStandardOutput = true;
Process proc = new Process();
proc.StartInfo = info;
proc.Start();
Now, If any error occurred in script while running from C# then how can fetch that SQL Exception in C#.