Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help Pin
OriginalGriff11-Feb-13 6:01
mveOriginalGriff11-Feb-13 6:01 
GeneralRe: Help Pin
Amir Mohammad Nasrollahi29-Jul-13 22:21
professionalAmir Mohammad Nasrollahi29-Jul-13 22:21 
AnswerRe: Help Pin
Pete O'Hanlon11-Feb-13 6:14
mvePete O'Hanlon11-Feb-13 6:14 
GeneralRe: Help Pin
Jibesh11-Feb-13 6:30
professionalJibesh11-Feb-13 6:30 
GeneralRe: Help Pin
Dave Kreskowiak11-Feb-13 7:27
mveDave Kreskowiak11-Feb-13 7:27 
GeneralRe: Help Pin
PIEBALDconsult11-Feb-13 15:30
mvePIEBALDconsult11-Feb-13 15:30 
GeneralRe: Help Pin
Dave Kreskowiak11-Feb-13 18:51
mveDave Kreskowiak11-Feb-13 18:51 
QuestionC# error message SystemCertificates\Disallowed Pin
classy_dog11-Feb-13 5:13
classy_dog11-Feb-13 5:13 
AnswerRe: C# error message SystemCertificates\Disallowed Pin
Abhinav S11-Feb-13 5:16
Abhinav S11-Feb-13 5:16 
AnswerRe: C# error message SystemCertificates\Disallowed Pin
Dave Kreskowiak11-Feb-13 5:49
mveDave Kreskowiak11-Feb-13 5:49 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
classy_dog11-Feb-13 6:37
classy_dog11-Feb-13 6:37 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
Dave Kreskowiak11-Feb-13 7:26
mveDave Kreskowiak11-Feb-13 7:26 
AnswerRe: C# error message SystemCertificates\Disallowed Pin
jschell11-Feb-13 8:14
jschell11-Feb-13 8:14 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
classy_dog11-Feb-13 16:40
classy_dog11-Feb-13 16:40 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
jschell12-Feb-13 14:17
jschell12-Feb-13 14:17 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
classy_dog12-Feb-13 11:19
classy_dog12-Feb-13 11:19 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
jschell12-Feb-13 14:20
jschell12-Feb-13 14:20 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
classy_dog12-Feb-13 16:18
classy_dog12-Feb-13 16:18 
QuestionHow to sent/receive sms in C# application? Pin
Anand Gunasekaran11-Feb-13 3:43
professionalAnand Gunasekaran11-Feb-13 3:43 
AnswerRe: How to sent/receive sms in C# application? Pin
José Amílcar Casimiro11-Feb-13 4:28
José Amílcar Casimiro11-Feb-13 4:28 
AnswerRe: How to sent/receive sms in C# application? Pin
Abhinav S11-Feb-13 5:21
Abhinav S11-Feb-13 5:21 
AnswerRe: How to sent/receive sms in C# application? Pin
jschell11-Feb-13 8:15
jschell11-Feb-13 8:15 
GeneralRe: How to sent/receive sms in C# application? Pin
Anand Gunasekaran11-Feb-13 23:21
professionalAnand Gunasekaran11-Feb-13 23:21 
AnswerRe: How to sent/receive sms in C# application? Pin
Amir Mohammad Nasrollahi29-Jul-13 22:23
professionalAmir Mohammad Nasrollahi29-Jul-13 22:23 
QuestionConstructor issue Pin
antrock10111-Feb-13 2:41
antrock10111-Feb-13 2:41 
Hello,

I'm having a few issues with my code, i'm following this tutorial http://www.homeandlearn.co.uk/csharp/csharp_s12p6.html Can anyone point me in the right direction. I've included my code below.

C#
The best overloaded method match for 'System.Data.SqlClient.SqlDataAdapter.SqlDataAdapter(string, System.Data.SqlClient.SqlConnection)

<pre lang="c#">Argument 2: cannot convert from 'System.Data.SqlServerCe.SqlCeConnection' to 'System.Data.SqlClient.SqlConnection'




C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Game
{
    public partial class Form1 : Form
    {
        public OpenFileDialog dialog = new OpenFileDialog();
        System.Data.SqlServerCe.SqlCeConnection con;
        System.Data.SqlServerCe.SqlCeDataAdapter da1;
        DataSet ds1;



        public Form1()
        {
            InitializeComponent();
        }

        private void btn_sel_Click(object sender, EventArgs e)
        {
            
            //dialog.Filter = "*.sdf";
            dialog.ShowDialog();
            MessageBox.Show(dialog.FileName);
            loadconnection();

        }

        private void btn_close_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        public void loadconnection()
        {
            con = new System.Data.SqlServerCe.SqlCeConnection();
            con.ConnectionString = "Data Source=" + dialog.FileName + ""; //opening dialog (selected file)

            con.Open();


            ds1 = new DataSet();
            string sql = "SELECT * From tbl_games";
            da1 = new System.Data.SqlClient.SqlDataAdapter(sql, con);
            da1.Fill(ds1, "Name");

            con.Close();
        }

    }
}

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.