Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 17:03

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

Advertisement



MySql Update frage

Discussion on MySql Update frage within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
Cyperghost's Avatar
 
elite*gold: 0
The Black Market: 379/0/0
Join Date: Jan 2013
Posts: 11,449
Received Thanks: 210
MySql Update frage

Wollte da mal fragen ob es möglich sein kann das jemand deuch diese funktion eine SQL Injection ausführen könnte?

Es handelt sich hierbei um asp.net

Code:
public bool Update(group_Options Option)
    {
        try
        {
            //create a SqlConnection to the DB
            SqlConnection con = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["Datenbank"].ConnectionString);
            //create a SqlCommand with the query tables to group_options table
            SqlCommand cmd = new SqlCommand("UPDATE group_options SET optionsID" + Option.ID + " = @optionid WHERE groupid = @groupid", con);
            //add the parameter 'optionid' 
            cmd.Parameters.AddWithValue("@optionid", Option.value);
            //add the parameter 'groupid' 
            cmd.Parameters.AddWithValue("@groupid", Option.groupID);
            //Open the SqlConnection
            con.Open();
            //check whether the SqlConnection is Open
            if (con.State == System.Data.ConnectionState.Open)
            {
                cmd.ExecuteNonQuery();
            }
            //Close the SqlConnection
            con.Close();
            return true;
        }
        catch
        {
            return false;
        }
    }
hier die class group_Options
Code:
public class group_Options
{
    public int groupID { get; set; }
    public int ID { get; set; }
    public string value { get; set; }
    public string name { get; set; }
    public string description { get; set; }
    public string type { get; set; }
}
Danke schon mal für eine antwort
Cyperghost is offline  
Old 08/03/2013, 20:20   #2
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
ja, so ziemlich jeder den ne decompiler hat

€dit, kleines bsp. query string nach belieben ändern, die beiden anderen sachen drunter rauslöschen, stack anpassen, fertig
tolio is offline  
Old 08/03/2013, 20:23   #3
 
Cyperghost's Avatar
 
elite*gold: 0
The Black Market: 379/0/0
Join Date: Jan 2013
Posts: 11,449
Received Thanks: 210
ja aber das ist doch ein Int wert den ich eintrage dort könnte man doch dann keine SQL Injection ausslösen oder doch ohne den Code zuverändern?

und ich glaube ich habe gerade in der Falschen sektion gepostet

Das ist für eine Website
Cyperghost is offline  
Old 08/03/2013, 20:26   #4
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
wird das hier beim user ausgeführt oder ist das asp.net ?
meines bezieht sich drauf wenn jemanden den code hat, also nen endnutzer programm
in asp kenn ich mich leider net genug aus
tolio is offline  
Old 08/03/2013, 20:44   #5
 
Cyperghost's Avatar
 
elite*gold: 0
The Black Market: 379/0/0
Join Date: Jan 2013
Posts: 11,449
Received Thanks: 210
Asp.net liegt nur auf den Server der code und der user kann ihn nicht sehen solange er ihn c# bzw. Vb.net geschrieben ist
Cyperghost is offline  
Old 08/03/2013, 20:49   #6
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
das ist mir schon klar, aber du hast oben nicht geschrieben das es um asp geht
tolio is offline  
Old 08/03/2013, 20:52   #7
 
Cyperghost's Avatar
 
elite*gold: 0
The Black Market: 379/0/0
Join Date: Jan 2013
Posts: 11,449
Received Thanks: 210
Ja hatte ich vergessen
Sorry
Cyperghost is offline  
Reply


Similar Threads Similar Threads
[H]Mysql Update in 2 Tabellen
01/13/2015 - Metin2 Private Server - 11 Replies
UPDATE account.account JOIN player.player JOIN account.ip_check SET account.status='BLOCK', ip_check.aPw='lol' WHERE account.id='3333431' AND player.name='xnoa'; es funktioniert nicht ganz wie ich möchte, in ip_chek.aPw werden alle werte auf 'lol' geändert hoffe mir kann jmd helfen. Mfg Noa
Mysql Update
07/07/2013 - Metin2 Private Server - 3 Replies
Wie die überschrift schon sagt wie Upgrade ich meinen Mysql server ohne das ich die Daten verliere bitte für Dummis erklären da ich das noch nie machen musste ;):D
[PHP&MySQL]Fehler bei der UPDATE Syntax
08/04/2012 - Web Development - 5 Replies
Hallo elitepvpers, ich habe da ein Problem bei dem Updaten von einer Zelle. Fehlermeldung: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character=testcharacter WHERE name=test' at line 2 PHP Code:
Problem with update Mysql.!
01/28/2012 - CO2 Private Server - 2 Replies
Hey Professionals i've Problem with my Source, i made Change Name Npc but there were a problem when i change my name from npc it doesn't make any sense. and i put the code it's not work My Source Uses SubSonic Two Codes Deon't Work First code



All times are GMT +1. The time now is 17:03.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.