Freelancer
Lounge-Member
Hallo jswelt,
habe da ein C#-Script, und weiß nicht, weshalb es nicht funktioniert:
Der Debugger meldet keinen Fehler.
Wisst Ihr weiter ??
Grüße
habe da ein C#-Script, und weiß nicht, weshalb es nicht funktioniert:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace SQLCommand
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection("user id=abc;" +
"password=abc;server=abcdef;" +
"Trusted_Connection=yes;" +
"database=abc; " +
"connection timeout=30");
SqlCommand myCommand = new SqlCommand("Command String", myConnection);
myCommand.CommandText = "INSERT INTO test (text, nr) " +
"Values ('string', 1)";
}
}
}
Der Debugger meldet keinen Fehler.
Wisst Ihr weiter ??
Grüße