Ich möchte eine XML-Datei zu einer SQL Server-Tabelle zuordnen.XML-Mapping zu SQL-Server
Das ist, was ich bisher getan habe:
XmlTextReader reader = new XmlTextReader("navetout.xml");
XmlNodeType type;
while (reader.Read())
{
type = reader.NodeType;
if(type == XmlNodeType.Element)
{
}
}
//using Entity framework
static void writeToDatabase()
{
BumsEntities _bums = new BumsEntities();
_bums.Seamen.Add(new Seamen
{
PersonalIdentityNumber = "",
ReferedCivicRegistrationNumber = "",
UnregistrationReason = "",
UnregistrationDate = "",
MessageComputerComputer = "",
GivenNameNumber = "",
FirstName = "",
MiddleName = "",
LastName = "",
NotifyName = "",
NationalRegistrationDate = "",
NationalRegistrationCountyCode = "",
NationalRegistrationMunicipalityCode = "",
NationalRegistrationCoAddress = "",
NationalRegistrationDistributionAddress1 = "",
NationalRegistrationDistributionAddress2 = "",
NationalRegistrationPostCode = "",
NationalRegistrationCity = "",
NationalRegistrationNotifyDistributionAddress = "",
NationalRegistrationNotifyPostCode = "",
NationalRegistrationNotifyCity = "",
ForeignDistrubtionAddress1 = "",
ForeignDistrubtionAddress2 = "",
ForeignDistrubtionAddress3 = "",
ForeignDistrubtionCountry = "",
ForeignDate = "",
BirthCountyCode = "",
BirthParish = "",
});
_bums.SaveChanges();
}
Der obige Code die Datenbankspalten ist. Ich möchte die XML-Datei laden und die Tags in die Spalten einfügen. Das Problem ist, dass ich nicht weiß, wie man die XML-Tags in die Datenbankspalten übersetzt. Kann mir jemand helfen?
"_bums" "Seamen" (゜ - ゜) –
Welche Sprache tun Sie dies in, btw? Ich nehme C# an? Sie möchten möglicherweise mit diesem (und Entitätsrahmen) markieren. –
@G_H Seemann ist der Tisch –