beste ben bezig met te werken aan een facturatie programma in c# nu bots ik op 1 probleempje namemijk
unrecoginzed escape sequence
dit is de code van het probleem
unrecoginzed escape sequence
dit is de code van het probleem
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.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
namespace Facturatie
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("(@Data Source=|DataDirectory|\Facturatie.sdf; Trustred_Connection=Yes");
//VOLGENS DEBUGER LIGT HET PROBLEEM Hier ERGENS:o
SqlCommand cmd = new SqlCommand(@"SELECT * FROM users WHERE username='"txtUsername +"' AND password = '"txtPassword +"'",conn);
conn.Open();
//NA PARSING PARAMETER OPEN VERBINDING
//MAKEN VAN INSTANTIE VOOR SQL DATA
SqlDataReader re = cmd.ExecuteReader();
if(re.Read())
{
MessageBox.Show("Login Succesfull");
//NA SUCCESVOL INLOGGEN MENU TONEN
Menu MN = new Menu();
MN.Show();
}
else
{
MessageBox.Show("Invalid Credentials");
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click_1(object sender, EventArgs e)
{
//CLEAR VELDEN
txtPassword.Clear();
txtUsername.Focus();
}
private void txtUsername_TextChanged(object sender, EventArgs e)
{
//TXT USERNAME FIELD
}
private void txtPassword_TextChanged(object sender, EventArgs e)
{
//TXT PASSWORD FIELD
}
private void label2_Click(object sender, EventArgs e)
{
MessageBox.Show("Please Contact the database administrator");
}
}
}