Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [C#] errore select strano..

    ciao ragazzi,
    ho questo codice ma mi restituisce un errore strano...
    Codice PHP:
           
            
    private void ResizeAndSave(Stream imgStr,int Widthint Height,string FileName)
            {
                
    MySqlConnection connection = new MySqlConnection();
                
    connection.ConnectionString "Data Source=localhost; Database=sup; User ID=admin; password=rda";
                
    //connection.Open();
                
                
    System.Data.SqlClient.SqlCommand cmd = new SqlCommand("SELECT id_foto from fotografie order by id_foto DESC"connection);
                try
                {
                
    connection.open;
                
    SqlDataReader myReader cmd.ExecuteReader();
                
    int id Myreader("id_foto");
                }
                catch(
    Exception e)
                    {
                
    Console.WriteLine("Exception Occured -->> {0}",e);
                } 
    il messaggio d'errore è questo:

    escription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0246: The type or namespace name 'SqlCommand' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

    Line 15: //connection.Open();
    Line 16:
    Line 17: System.Data.SqlClient.SqlCommand cmd = new SqlCommand("SELECT id_foto from fotografie order by id_foto DESC", connection);
    Line 18: try
    Line 19: {
    qualche idea !?
    -------------------------
    ..::`DrUmM\n0`::..
    www.jonathandomenici.com

  2. #2
    risolto... uso Mysql quindi i nomi devono essere non Sql.. ma MySql....
    -------------------------
    ..::`DrUmM\n0`::..
    www.jonathandomenici.com

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.