Format of the initialization string does not conform to specification starting at ind

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tomenjerry
    New Member
    • Apr 2013
    • 1

    Format of the initialization string does not conform to specification starting at ind

    im having an error. please help me.. many thanks!
    heres my code.


    Code:
    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;
    using System.Data.SqlServerCe;
    
    
    namespace Project1
    {
    
        
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
          
            
            System.Data.SqlServerCe.SqlCeDataAdapter da;
            DataSet ds1;
    
           
            private void button1_Click(object sender, EventArgs e)
            {
                System.Data.SqlServerCe.SqlCeConnection konek;
               // System.Data.SqlServerCe.SqlCeConnection[Confi.AppSettings["EventConnectionString"]); 
                
                konek = new System.Data.SqlServerCe.SqlCeConnection();
                konek.ConnectionString = "C:\\Users\\BRAVO\\Documents\\Visual Studio 2008\\Projects\\Project1\\Project1\\Database1.sdf";
                konek.Open();
    
                DataTable dt = new DataTable();
    
                ds1 = new DataSet();
                string sql = "SELECT * FROM security WHERE username ='"+textBox1.Text+"' and password = '"+textBox2.Text+"'";
                da = new System.Data.SqlServerCe.SqlCeDataAdapter(sql, konek);
                da.Fill(ds1, "security");
    
                if (dt.Rows.Count > 0)
                {
                    Main secondform;
                    secondform = new Main();
                    this.Dispose();
    
                }
    
                else
                    MessageBox.Show("Invalid Username/Password");
    
                konek.Close();
    
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
    
            }
    
            private void button2_Click(object sender, EventArgs e)
            {
                Application.Exit();
            }
        }
    }
    Last edited by acoder; Apr 24 '13, 12:08 PM. Reason: Please use [code] tags when posting code
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    It would help to see the full error message and the line number that throws the error.

    Comment

    Working...