Witam
Dopiero raczkuje w visual C# - wersja 2008.
Mam problem :/ mam nastepujacy programik(tak najprosciej bez przechwytywania bledow):
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;
namespace Dziennik
{
public partial class Plan_Lekcji : Form
{
public Plan_Lekcji()
{
InitializeComponent();
}
private void Plan_Lekcji_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = @"Data Source=.\SQLEXPRESS;database = Dziennik;Persist Security Info=False;User ID=<user name>;Password=<your password>";
this.plan_LekcjiTableAdapter.Fill(this.dziennikDataSet.Plan_Lekcji);
}
private void Plan_LekcjiNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.planLekcjiBindingSource.EndEdit();
this.plan_LekcjiTableAdapter.Update(this.dziennikDataSet.Plan_Lekcji);
}
}
}
Jak zrobię bazę accessa mdb wszystko idzie super, a jak polacze to z baza sql(nawet bezposrednio do pliku) to nie lapie [???] Walcze z tym juz mase czasu. W Internecie nic nie moge znalezc hmm. Po wpisaniu do rekordow jakis danych i probie zapisu do datagridu wyskakuje komunikat:
Operacja Update wymaga prawidłowego elementu UpdateCommand podczas przekazywania kolekcji DataRow ze zmodyfikowanymi wierszami.
i zaznacza mi linijke:
this.plan_LekcjiTableAdapter.Update(this.dziennikDataSet.Plan_Lekcji);
Czy ktos moglby mi z tym pomoc sad ? jak to zrobic hmm ???
dziekuje z gory i pozdrawiam