Click here to Skip to main content
16,004,761 members
Home / Discussions / C#
   

C#

 
QuestionC1flexGrid Pin
sujithkumarsl19-Dec-06 23:10
sujithkumarsl19-Dec-06 23:10 
QuestionCopy Object In Memory Pin
Tristan Rhodes19-Dec-06 22:53
Tristan Rhodes19-Dec-06 22:53 
AnswerRe: Copy Object In Memory Pin
Bekjong19-Dec-06 23:33
Bekjong19-Dec-06 23:33 
GeneralRe: Copy Object In Memory Pin
Tristan Rhodes20-Dec-06 0:30
Tristan Rhodes20-Dec-06 0:30 
GeneralRe: Copy Object In Memory Pin
Bekjong20-Dec-06 1:22
Bekjong20-Dec-06 1:22 
QuestionDataGridView with a RichTextBox Column (read only) Pin
fatamos19-Dec-06 22:47
fatamos19-Dec-06 22:47 
AnswerRe: DataGridView with a RichTextBox Column (read only) Pin
mrwisdom17-Dec-08 20:45
mrwisdom17-Dec-08 20:45 
QuestionC# Newbie needs help with Error Pin
wedtm19-Dec-06 22:47
wedtm19-Dec-06 22:47 
Okay, I have this function that I want to run, it's pretty simple, but for the life of me, It's not working, can someone take a look at it and let me know what you think? It's like connectionStr never gets set, yet the way I call it is MysqlNonQuery("SELECT * FROM account", 1);

<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using MySql.Data.MySqlClient;<br />
<br />
namespace mangosAdmin<br />
{<br />
    class functions<br />
    {<br />
        public static string MysqlNonQuery(string sql, int db)<br />
        {<br />
            string connectionStr;<br />
            <br />
            if (db == 1) // Select 1 for mangos DB<br />
            {<br />
                connectionStr = "Database:" + Properties.Settings.Default.mangosDB + ";Source=" + Properties.Settings.Default.mangosHost + ";User Id=" + Properties.Settings.Default.mangosUser + ";Password=" + Properties.Settings.Default.mangosPass;<br />
            }<br />
            else if (db == 2) // Select 2 for Realm DB<br />
            {<br />
                connectionStr = "Database:" + Properties.Settings.Default.realmDB + ";Source=" + Properties.Settings.Default.realmHost + ";User Id=" + Properties.Settings.Default.realmUser + ";Password=" + Properties.Settings.Default.realmPass;<br />
            }<br />
            else<br />
            {<br />
                connectionStr = "Database:" + Properties.Settings.Default.mangosDB + ";Source=" + Properties.Settings.Default.mangosHost + ";User Id=" + Properties.Settings.Default.mangosUser + ";Password=" + Properties.Settings.Default.mangosPass;<br />
            }<br />
            try<br />
            {<br />
                MySqlConnection myConnection = new MySqlConnection(connectionStr);<br />
                MySqlCommand myCommand = new MySqlCommand(sql);<br />
                myCommand.Connection = myConnection;<br />
                myConnection.Open();<br />
                myCommand.ExecuteNonQuery();<br />
                myCommand.Connection.Close();<br />
            }<br />
            catch (MySqlException ex)<br />
            {<br />
                return(ex.Number+ex.Message);<br />
            }<br />
<br />
            return ("0");<br />
            <br />
<br />
        }<br />
<br />
        <br />
    }<br />
}<br />

AnswerRe: C# Newbie needs help with Error [modified] Pin
althamda19-Dec-06 23:04
althamda19-Dec-06 23:04 
QuestionError?!! Pin
Nafiseh Salmani19-Dec-06 22:10
Nafiseh Salmani19-Dec-06 22:10 
AnswerRe: Error?!! Pin
Guffa19-Dec-06 22:26
Guffa19-Dec-06 22:26 
GeneralRe: Error?!! Pin
Nafiseh Salmani19-Dec-06 23:37
Nafiseh Salmani19-Dec-06 23:37 
AnswerRe: Error?!! Pin
Guffa20-Dec-06 1:47
Guffa20-Dec-06 1:47 
GeneralRe: Error?!! Pin
Dave Kreskowiak20-Dec-06 6:02
mveDave Kreskowiak20-Dec-06 6:02 
GeneralRe: Error?!! Pin
Nafiseh Salmani21-Dec-06 23:19
Nafiseh Salmani21-Dec-06 23:19 
QuestionInvoking events on a different thread... Pin
Shy Agam19-Dec-06 22:03
Shy Agam19-Dec-06 22:03 
AnswerRe: Invoking events on a different thread... Pin
Tristan Rhodes20-Dec-06 0:41
Tristan Rhodes20-Dec-06 0:41 
GeneralRe: Invoking events on a different thread... Pin
Shy Agam20-Dec-06 2:16
Shy Agam20-Dec-06 2:16 
GeneralRe: Invoking events on a different thread... Pin
Tristan Rhodes20-Dec-06 2:30
Tristan Rhodes20-Dec-06 2:30 
GeneralRe: Invoking events on a different thread... Pin
Shy Agam20-Dec-06 2:37
Shy Agam20-Dec-06 2:37 
GeneralRe: Invoking events on a different thread... Pin
Tristan Rhodes20-Dec-06 3:10
Tristan Rhodes20-Dec-06 3:10 
GeneralRe: Invoking events on a different thread... Pin
Shy Agam20-Dec-06 3:23
Shy Agam20-Dec-06 3:23 
GeneralRe: Invoking events on a different thread... Pin
Tristan Rhodes20-Dec-06 3:35
Tristan Rhodes20-Dec-06 3:35 
GeneralRe: Invoking events on a different thread... Pin
Shy Agam20-Dec-06 3:47
Shy Agam20-Dec-06 3:47 
GeneralRe: Invoking events on a different thread... Pin
Tristan Rhodes20-Dec-06 3:56
Tristan Rhodes20-Dec-06 3:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.