Changeset 110

Show
Ignore:
Timestamp:
03/03/07 12:10:20 (2 years ago)
Author:
bsmith7
Message:

Fixed some small bugs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmp/trunk/BadClient/Form1.cs

    r97 r110  
    2020 
    2121                private void button1_Click(object sender, EventArgs e) { 
    22             try 
    23            
     22            //try 
     23            //
    2424                if (myBridge.AddServerConnection(txtHost.Text, ushort.Parse(txtPort.Text)) > 0) 
    2525                { 
     
    3737                    lblStatus.Text = "Status: It didn't connect..."; 
    3838                } 
    39            
     39            /*
    4040            catch (Exception exception) 
    4141            { 
     
    4343                MessageBox.Show("Exception occurred in "+ 
    4444                    exception.Source+" (check output for backtrace): " + exception.Message); 
    45             } 
     45            }*/ 
    4646                } 
    4747 
  • dmp/trunk/daap-sharp/BridgeDatabase.cs

    r104 r110  
    128128            logFile.WriteLine("adding " + theClient.Address + " to libraries"); logFile.Flush(); 
    129129            IDbCommand command = this.databaseConnection.CreateCommand(); 
    130             command.CommandText = @"insert into libraries  
    131                                   ( address, port, name, username, password ) values ( 
    132                                   '" + theClient.Address + @"',  
    133                                   '" + theClient.Port + @"',  
    134                                   '" + theClient.Name + @"',  
    135                                   '" + theClient.Username + @"',  
    136                                   '" + theClient.Password + @"'); 
     130            command.CommandText = @"INSERT INTO libraries  
     131                                  (name, username, password ) values (?, ?, ?); 
    137132                                  SELECT last_insert_rowid();"; 
     133            IDataParameter clientName = command.CreateParameter(); 
     134            command.Parameters.Add(clientName); 
     135            IDataParameter clientUsername = command.CreateParameter(); 
     136            command.Parameters.Add(clientUsername); 
     137            IDataParameter clientPassword = command.CreateParameter(); 
     138            command.Parameters.Add(clientPassword); 
     139 
     140            clientName.Value = theClient.Name; 
     141            clientUsername.Value = theClient.Username; 
     142            clientPassword.Value = theClient.Password; 
    138143             
    139144            //IDbCommand command2 = this.databaseConnection.CreateCommand();