This question is locked. New answers and comments are not allowed.
I want to add new entity to database using telerik
At starting,I tried to generate Table Class and set members using set procedure.
this works when no inner relationship betwwen tables
now ı want to insert a new record to table with inner relationship.I have tried using native sql using sample in this page.But this doesn't work.This is my code.
if(!m_scope.Transaction.IsActive)
{
m_scope.Transaction.Begin();
}
//UNIQUEIDENTIFIER
try
{
for (int i = 0; i < m_loadedAirToAirMunition.Count; i++)
{
IQuery query = m_scope.GetSqlQuery("sp_ins_Pltfrm_Conf ?,?,?,?",
null,
"UNIQUEIDENTIFIER object_ID, UNIQUEIDENTIFIER platform_ID, INTEGER configuration_item_type, INTEGER quantity");
IQueryResult a = query.Execute(new object[] {((WeaponMissileAirToAir)m_loadedAirToAirWeaponMissile[i]).Id, selectedAirPlatform.Id, Constants.CHANGE_CONFIGURATION_MUNITION_AIR_AIR, ((MunitionPresentation)m_loadedAirToAirMunition[i]).getMunitionQuantity() });
}
m_scope.Transaction.Commit();
}
catch (Exception e)
{
string a = e.Message;
}
At starting,I tried to generate Table Class and set members using set procedure.
this works when no inner relationship betwwen tables
now ı want to insert a new record to table with inner relationship.I have tried using native sql using sample in this page.But this doesn't work.This is my code.
if(!m_scope.Transaction.IsActive)
{
m_scope.Transaction.Begin();
}
//UNIQUEIDENTIFIER
try
{
for (int i = 0; i < m_loadedAirToAirMunition.Count; i++)
{
IQuery query = m_scope.GetSqlQuery("sp_ins_Pltfrm_Conf ?,?,?,?",
null,
"UNIQUEIDENTIFIER object_ID, UNIQUEIDENTIFIER platform_ID, INTEGER configuration_item_type, INTEGER quantity");
IQueryResult a = query.Execute(new object[] {((WeaponMissileAirToAir)m_loadedAirToAirWeaponMissile[i]).Id, selectedAirPlatform.Id, Constants.CHANGE_CONFIGURATION_MUNITION_AIR_AIR, ((MunitionPresentation)m_loadedAirToAirMunition[i]).getMunitionQuantity() });
}
m_scope.Transaction.Commit();
}
catch (Exception e)
{
string a = e.Message;
}