[C#] Reading and Analysing SQL file

08/17/2014 19:09 Buckyx#1
Hi all, I download sql file with webclient and want to analyse straight after
I dont know what to put in connection parameters for SqlConnection

if anyone wants to help me here is sql file: [Only registered and activated users can see links. Click Here To Register...]
each line contains
Code:
INSERT INTO `x_world` VALUES (1517,315,399,3,181705,'New Remial',82126,'Tale',0,'',273);
this is what Ive got
Code:
private void m_WebClient_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            var l_SqlText = System.IO.File.ReadAllText(Application.StartupPath + "/" + m_FileName);
            var sqlStatements = l_SqlText.Split(';');

            using (SqlConnection l_SqlConnection = new SqlConnection(l_SqlText))
            {
                l_SqlConnection.Open();
                foreach (var sqlStatement in sqlStatements)
                {
                    SqlCommand command = new SqlCommand(sqlStatement, l_SqlConnection);
                    command.ExecuteNonQuery();   
                }
            }
        }
08/21/2014 12:33 Mete#2
To use a direct SQL-Connection in youre .net application causes a very high security risk, reversing an .net application back into soucecode (which would content sql-login-values) makes it possible to get these data as plaintext.

More secure would be e.g.:
.NET -> Plaindata / Command
.NET -> Send this data via POST to an PHP-Script (Hosted on youre webserver)
PHP -> Executes sql query and stores sql-connection details.