Click here to Skip to main content
15,921,452 members
Home / Discussions / C#
   

C#

 
AnswerRe: Maximum number of lines within a class Pin
Bernhard Hiller12-May-10 3:56
Bernhard Hiller12-May-10 3:56 
Questionsn.exe, public key question Pin
Ryan Minor11-May-10 4:28
Ryan Minor11-May-10 4:28 
AnswerRe: sn.exe, public key question Pin
Peace ON11-May-10 4:49
Peace ON11-May-10 4:49 
QuestionUnknown connection option in connection string: provider. Pin
Tunisien8611-May-10 2:58
Tunisien8611-May-10 2:58 
AnswerRe: Unknown connection option in connection string: provider. Pin
dan!sh 11-May-10 3:26
professional dan!sh 11-May-10 3:26 
GeneralRe: Unknown connection option in connection string: provider. Pin
Tunisien8611-May-10 3:35
Tunisien8611-May-10 3:35 
GeneralRe: Unknown connection option in connection string: provider. Pin
dan!sh 11-May-10 3:45
professional dan!sh 11-May-10 3:45 
GeneralRe: Unknown connection option in connection string: provider. Pin
Tunisien8611-May-10 4:16
Tunisien8611-May-10 4:16 
Hi,
Do u mean by attach database file by:join the database file to database field in sql server?If this,I do it.
My code is below:
private void Form6_Load(object sender, EventArgs e)
        {

            string sConnection = "Data Source=127.0.0.1,1433;Persist Security Info=True;Initial Catalog=GMAO;User ID=sa;Password=sa";
            string sSQL = "SELECT [M-MO] FROM Marge; ";
            SqlConnection conn = new SqlConnection(sConnection);
            SqlCommand comm = new SqlCommand(sSQL, conn);
            SqlDataReader dr = null;
            try
            {

                comm.Connection.Open();
                dr = comm.ExecuteReader();
                while (dr.Read())
                    comboBox1.Items.Add(dr[0]);
            }
            catch (SqlException ex)
            {
                //MessageBox.Show("connexion impossible");
                MessageBox.Show(ex.Message);
                return;
            }

            dr.Close();
            comm.Connection.Close();
        }

If the program connects to the server,it will fill the combobox with data of the select statement.
But,the error"Specified sql server not found or access denied Cry | :(( lets me cry.
Thanks
AnswerRe: Unknown connection option in connection string: provider. Pin
Tunisien8611-May-10 5:45
Tunisien8611-May-10 5:45 
AnswerRe: Unknown connection option in connection string: provider. Pin
William Winner11-May-10 6:05
William Winner11-May-10 6:05 
GeneralRe: Unknown connection option in connection string: provider. Pin
Tunisien8611-May-10 6:11
Tunisien8611-May-10 6:11 
QuestionDLL import problem Pin
SelvaKr11-May-10 0:33
SelvaKr11-May-10 0:33 
AnswerRe: DLL import problem Pin
Luc Pattyn11-May-10 2:11
sitebuilderLuc Pattyn11-May-10 2:11 
GeneralRe: DLL import problem Pin
SelvaKr13-May-10 23:43
SelvaKr13-May-10 23:43 
QuestionPass an argument to use with a foreach loop Pin
Mc_Topaz10-May-10 23:59
Mc_Topaz10-May-10 23:59 
AnswerRe: Pass an argument to use with a foreach loop Pin
OriginalGriff11-May-10 0:31
mveOriginalGriff11-May-10 0:31 
GeneralRe: Pass an argument to use with a foreach loop Pin
Mc_Topaz11-May-10 0:55
Mc_Topaz11-May-10 0:55 
AnswerRe: Pass an argument to use with a foreach loop Pin
Abhinav S11-May-10 0:47
Abhinav S11-May-10 0:47 
AnswerRe: Pass an argument to use with a foreach loop Pin
sam#11-May-10 0:57
sam#11-May-10 0:57 
AnswerRe: Pass an argument to use with a foreach loop Pin
Luc Pattyn11-May-10 2:20
sitebuilderLuc Pattyn11-May-10 2:20 
Questiongetting ini value Pin
Member 59031010-May-10 22:27
Member 59031010-May-10 22:27 
AnswerRe: getting ini value Pin
OriginalGriff10-May-10 22:49
mveOriginalGriff10-May-10 22:49 
AnswerRe: getting ini value Pin
PIEBALDconsult11-May-10 3:38
mvePIEBALDconsult11-May-10 3:38 
QuestionSending data through SOAP Pin
Priya Prk10-May-10 21:49
Priya Prk10-May-10 21:49 
AnswerRe: Sending data through SOAP Pin
Abhinav S10-May-10 22:33
Abhinav S10-May-10 22:33 

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.