Click here to Skip to main content
       

C#

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: C# error message SystemCertificates\Disallowedmemberclassy_dog12-Feb-13 16:18 
QuestionHow to sent/receive sms in C# application?memberAnand Gunasekaran11-Feb-13 3:43 
AnswerRe: How to sent/receive sms in C# application?memberJosé Amílcar Ferreira Casimiro11-Feb-13 4:28 
AnswerRe: How to sent/receive sms in C# application?mvpAbhinav S11-Feb-13 5:21 
AnswerRe: How to sent/receive sms in C# application?memberjschell11-Feb-13 8:15 
GeneralRe: How to sent/receive sms in C# application?memberAnand Gunasekaran11-Feb-13 23:21 
QuestionConstructor issuememberantrock10111-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.
 
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 issuemvpAbhinav S11-Feb-13 2:51 
GeneralRe: Constructor issuememberantrock10111-Feb-13 3:43 
GeneralRe: Constructor issuemvpRichard MacCutchan11-Feb-13 4:45 
GeneralRe: Constructor issuememberantrock10111-Feb-13 4:55 
GeneralRe: Constructor issuemvpRichard MacCutchan11-Feb-13 5:10 
GeneralRe: Constructor issuememberjibesh11-Feb-13 6:38 
AnswerRe: Constructor issuememberShameel11-Feb-13 5:02 
Questionif loop cant excuted properlymemberabhishek80800011-Feb-13 0:36 
AnswerRe: if loop cant excuted properlyprotectorPete O'Hanlon11-Feb-13 0:45 
AnswerRe: if loop cant excuted properlymvpDave Kreskowiak11-Feb-13 2:09 
AnswerRe: if loop cant excuted properlymemberBernhard Hiller11-Feb-13 2:27 
GeneralRe: if loop cant excuted properlymemberSimon_Whale11-Feb-13 3:58 
AnswerRe: if loop cant excuted properlymemberJegan Thiyagesan11-Feb-13 6:27 
GeneralRe: if loop cant excuted properlymemberabhishek80800011-Feb-13 8:06 
GeneralRe: if loop cant excuted properlymemberDanielSheets19-Feb-13 7:59 
QuestionInvoke schedule task using .NET programmembersiddisagar11-Feb-13 0:30 
AnswerRe: Invoke schedule task using .NET programmvpDave Kreskowiak11-Feb-13 2:12 
GeneralRe: Invoke schedule task using .NET programmembersiddisagar11-Feb-13 21:47 

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


Advertise | Privacy | Mobile
Web04 | 2.6.130619.1 | Last Updated 19 Jun 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid