Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 11:52

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C#] Reading and Analysing SQL file

Discussion on [C#] Reading and Analysing SQL file within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
Buckyx's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 177
Received Thanks: 2
[C#] Reading and Analysing SQL file

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:
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();   
                }
            }
        }
Buckyx is offline  
Old 08/21/2014, 12:33   #2
 
elite*gold: 0
Join Date: Apr 2007
Posts: 229
Received Thanks: 37
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.
Mete is offline  
Reply


Similar Threads Similar Threads
Reading Encrypted file, possible?
02/17/2013 - Elsword - 10 Replies
Hey guys, I wonder if it's possible to read Item.lua files in Elsword Box, pretty much I can do everything but not to .lua files, any help anyone? Pretty much thanks (For reading)
[Question/Problem] Reading Web TxT File, Copying
02/19/2012 - AutoIt - 4 Replies
Hi. I'm working at launcher for my server. How I can do something like that: I have news.txt on mywebsite.com/news.txt and I wish to program reads from this file and show that in section (image). Image: http://i.imgur.com/LypEr.png Second Question. How I can make copying files with ProgressBar? I did Copying with Filecopy() and DirCreate. Button 1 (image) is copying files from /1/ for /2/, button 2 from /2/ to /1/ correctly, but how show progress on the Bar? PS. Thanks for Help, and...
[Help]Reading pcclass file
07/29/2011 - Dekaron Private Server - 1 Replies
I'm pretty new to this stuff, and I'm trying to figure out what each of these do so I can make a table for each class of how the stats affect their character. I've looked everywhere I can think of and I can't find this information anywhere. If anyone can translate these for me, I'd really appreciate the help. Thanks in advance! class 0 1 2 3 4 5 6 size 1 1 1 1 1 2 1 name_eng SWORDMAN ARCHER SORCER SUMMON SEGNALLE W ARRIOR ALLOKEN name_kor Azure Knight Segita Hunter Incar Magician Vicious...
[Help]When reading/writing from a file
10/08/2010 - CO2 Private Server - 3 Replies
Hello guys...I have 1 or 2 question about reading and writing from a file. Reading: After you have read all the infos from the file you use filestream.close(); binaryreader.close I am wondering...if I insert a filstream.flush() (before filestream.close()) does it have any effect? or is it necessary in reading a file? (as the flush() void says it clears all buffers and causes any buffered data to be writen to the file) Writing:
reading through a file
04/12/2009 - Silkroad Online - 2 Replies
when people post files on this site, other people always wanna know or it is safe but an antivirus check doesn't always work since your antivirus considers bots and hacks almost always as a virus /trojan and then people say, it's safe, i read through it but now i wonder how can you see the source of the program? how can i check it by myself because i got yesterday a big virus from a fake sibibot



All times are GMT +1. The time now is 11:53.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.