API
Version 7.x > API > Insert query for "MyTable" table in Database View modes: 
User avatar
Member
Member
hitesh - 4/30/2013 6:36:08 AM
   
Insert query for "MyTable" table in Database
Hi everyone,

I want to insert into a table "TaskComment" which I have created inside kentico database.
My code is below
 CustomTableItemProvider tblProv = new customTable....

DataClassInfo customTableInfo =
DataClassInfoProvider.GetDataClass("PM_TaskComment");

if(customTableInfo != null)
{
CustomTableItem newCustomTableItem = customTableItem.New("PM_TaskComment,tblProvider)
.....
}

I tried using object of customTableItem but
DataClassInfoProvider.GetDataClass("TaskComment") return null.

Please guide me.

Thanks.
Hitesh

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 4/30/2013 6:47:59 AM
   
RE:Insert query for "MyTable" table in Database
Hello Hitesh,

as first... could you please describe how did you create your custom table? Have you been following the Developers Guide - section Creating custom tables?

Best regards,
Martin Danko

User avatar
Member
Member
hitesh - 4/30/2013 6:57:50 AM
   
RE:Insert query for "MyTable" table in Database
hi martin,
Yes I've been following the Developers Guide - section Creating custom tables. I created my table in MSSQL 2005 then wrote the code in a AppCode folder in TaskCommentInfo.cs file. But i couldn't insert into the table. What colud be the issue.
Please help me.

Thanks,
Hitesh

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 5/15/2013 3:54:32 AM
   
RE:Insert query for "MyTable" table in Database
Hello Hitesh,

when you say "I created my table in MSSQL 2005" ... do you mean that you have created the table directly in the Database via e.g. SQL Server Management Studio or via CMS Site Manager?

Best regards,
Martin Danko