Click here to Skip to main content
12,691,948 members (30,533 online)
   

C#

 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
Dave Kreskowiak11-Feb-13 8:26
mvpDave Kreskowiak11-Feb-13 8:26 
AnswerRe: C# error message SystemCertificates\Disallowed Pin
jschell11-Feb-13 9:14
memberjschell11-Feb-13 9:14 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
classy_dog11-Feb-13 17:40
memberclassy_dog11-Feb-13 17:40 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
jschell12-Feb-13 15:17
memberjschell12-Feb-13 15:17 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
classy_dog12-Feb-13 12:19
memberclassy_dog12-Feb-13 12:19 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
jschell12-Feb-13 15:20
memberjschell12-Feb-13 15:20 
GeneralRe: C# error message SystemCertificates\Disallowed Pin
classy_dog12-Feb-13 17:18
memberclassy_dog12-Feb-13 17:18 
QuestionHow to sent/receive sms in C# application? Pin
Anand Gunasekaran11-Feb-13 4:43
memberAnand Gunasekaran11-Feb-13 4:43 
AnswerRe: How to sent/receive sms in C# application? Pin
José Amílcar Ferreira Casimiro11-Feb-13 5:28
memberJosé Amílcar Ferreira Casimiro11-Feb-13 5:28 
AnswerRe: How to sent/receive sms in C# application? Pin
Abhinav S11-Feb-13 6:21
mvpAbhinav S11-Feb-13 6:21 
AnswerRe: How to sent/receive sms in C# application? Pin
jschell11-Feb-13 9:15
memberjschell11-Feb-13 9:15 
GeneralRe: How to sent/receive sms in C# application? Pin
Anand Gunasekaran12-Feb-13 0:21
memberAnand Gunasekaran12-Feb-13 0:21 
AnswerRe: How to sent/receive sms in C# application? Pin
Amir Mohammad Nasrollahi29-Jul-13 23:23
professionalAmir Mohammad Nasrollahi29-Jul-13 23:23 
QuestionConstructor issue Pin
antrock10111-Feb-13 3:41
memberantrock10111-Feb-13 3: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.

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'




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();
        }

    }
}

AnswerRe: Constructor issue Pin
Abhinav S11-Feb-13 3:51
mvpAbhinav S11-Feb-13 3:51 
GeneralRe: Constructor issue Pin
antrock10111-Feb-13 4:43
memberantrock10111-Feb-13 4:43 
GeneralRe: Constructor issue Pin
Richard MacCutchan11-Feb-13 5:45
mvpRichard MacCutchan11-Feb-13 5:45 
GeneralRe: Constructor issue Pin
antrock10111-Feb-13 5:55
memberantrock10111-Feb-13 5:55 
GeneralRe: Constructor issue Pin
Richard MacCutchan11-Feb-13 6:10
mvpRichard MacCutchan11-Feb-13 6:10 
GeneralRe: Constructor issue Pin
jibesh11-Feb-13 7:38
memberjibesh11-Feb-13 7:38 
AnswerRe: Constructor issue Pin
Shameel11-Feb-13 6:02
memberShameel11-Feb-13 6:02 
Questionif loop cant excuted properly Pin
abhishek80800011-Feb-13 1:36
memberabhishek80800011-Feb-13 1:36 
AnswerRe: if loop cant excuted properly Pin
Pete O'Hanlon11-Feb-13 1:45
protectorPete O'Hanlon11-Feb-13 1:45 
AnswerRe: if loop cant excuted properly Pin
Dave Kreskowiak11-Feb-13 3:09
mvpDave Kreskowiak11-Feb-13 3:09 
AnswerRe: if loop cant excuted properly Pin
Bernhard Hiller11-Feb-13 3:27
memberBernhard Hiller11-Feb-13 3:27 
GeneralRe: if loop cant excuted properly Pin
Simon_Whale11-Feb-13 4:58
memberSimon_Whale11-Feb-13 4:58 
AnswerRe: if loop cant excuted properly Pin
Jegan Thiyagesan11-Feb-13 7:27
memberJegan Thiyagesan11-Feb-13 7:27 
GeneralRe: if loop cant excuted properly Pin
abhishek80800011-Feb-13 9:06
memberabhishek80800011-Feb-13 9:06 
GeneralRe: if loop cant excuted properly Pin
DanielSheets19-Feb-13 8:59
memberDanielSheets19-Feb-13 8:59 
QuestionInvoke schedule task using .NET program Pin
siddisagar11-Feb-13 1:30
membersiddisagar11-Feb-13 1:30 
AnswerRe: Invoke schedule task using .NET program Pin
Dave Kreskowiak11-Feb-13 3:12
mvpDave Kreskowiak11-Feb-13 3:12 
GeneralRe: Invoke schedule task using .NET program Pin
siddisagar11-Feb-13 22:47
membersiddisagar11-Feb-13 22:47 
GeneralRe: Invoke schedule task using .NET program Pin
Dave Kreskowiak12-Feb-13 12:46
mvpDave Kreskowiak12-Feb-13 12:46 
AnswerRe: Invoke schedule task using .NET program Pin
José Amílcar Ferreira Casimiro11-Feb-13 4:35
memberJosé Amílcar Ferreira Casimiro11-Feb-13 4:35 
Questionstoring images to folder in c# Pin
dhiraj3110-Feb-13 10:40
memberdhiraj3110-Feb-13 10:40 
AnswerRe: storing images to folder in c# Pin
Garth J Lancaster10-Feb-13 10:53
memberGarth J Lancaster10-Feb-13 10:53 
Questionstoring images to folder in c# Pin
dhiraj3110-Feb-13 10:38
memberdhiraj3110-Feb-13 10:38 
GeneralRe: storing images to folder in c# Pin
Pete O'Hanlon10-Feb-13 11:07
protectorPete O'Hanlon10-Feb-13 11:07 
QuestionHow to create a C# Application which can automatically install an Application or server ? Pin
Rahul Sarkar10-Feb-13 7:43
memberRahul Sarkar10-Feb-13 7:43 
AnswerRe: How to create a C# Application which can automatically install an Application or server ? Pin
Rahul Sarkar10-Feb-13 7:58
memberRahul Sarkar10-Feb-13 7:58 
AnswerRe: How to create a C# Application which can automatically install an Application or server ? Pin
Jegan Thiyagesan13-Feb-13 3:52
memberJegan Thiyagesan13-Feb-13 3:52 
QuestionC# connection pooling Pin
classy_dog9-Feb-13 22:52
memberclassy_dog9-Feb-13 22:52 
AnswerRe: C# connection pooling Pin
N a v a n e e t h10-Feb-13 4:19
memberN a v a n e e t h10-Feb-13 4:19 
GeneralRe: C# connection pooling Pin
PIEBALDconsult10-Feb-13 5:51
memberPIEBALDconsult10-Feb-13 5:51 
GeneralRe: C# connection pooling Pin
jschell10-Feb-13 9:10
memberjschell10-Feb-13 9:10 
GeneralRe: C# connection pooling Pin
PIEBALDconsult10-Feb-13 18:02
memberPIEBALDconsult10-Feb-13 18:02 
AnswerRe: C# connection pooling Pin
jschell10-Feb-13 9:28
memberjschell10-Feb-13 9:28 
QuestionProtocol Handler C# Pin
thomas mason9-Feb-13 16:44
memberthomas mason9-Feb-13 16:44 
AnswerRe: Protocol Handler C# Pin
jibesh9-Feb-13 19:59
memberjibesh9-Feb-13 19:59 
AnswerRe: Protocol Handler C# Pin
N a v a n e e t h10-Feb-13 3:44
memberN a v a n e e t h10-Feb-13 3:44 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.170117.1 | Last Updated 17 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid