Hi. I create the table (MS SQL 2008)
IdUrovniaKatHerakl - HierarchyId (not null primary key),
KatName nvarchar(max) not null,
LevelKat as RowId.GetLevel()
KatId - int
KatOpisanie nvarchar(max)
How can I using C# in Visual Studio 2010 (RC) insert new data into this table?
I do this: create DataSet and Create TableAdapter for this table
DataSet1 ds = new DataSet1();
DataSet1TableAdapters.KategoriiFotoTableAdapter kategoriiFotoTableAdapter = new DataSet1TableAdapters.KategoriiFotoTableAdapter();
DataSet1.KategoriiFotoRow newKategoriiFotoRow = ds.KategoriiFoto.NewKategoriiFotoRow();
SqlHierarchyId her;
SqlHierarchyId gt = SqlHierarchyId.Null;
newKategoriiFotoRow.IdUrovniaKatHerakl = (her.GetDescendant(gt,null));
newKategoriiFotoRow.KatName = TextBox1.Text;
newKategoriiFotoRow.KatOpisanie = "'eto opisanie";
ds.KategoriiFoto.Rows.Add(newKategoriiFotoRow);
kategoriiFotoTableAdapter.Update(ds.KategoriiFoto);
But it does not work, eror in "newKategoriiFotoRow.IdUrovniaKatHerakl = (her.GetDescendant(gt,null));"
help me. Roman