TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mahesh pardeshi
NA
37
56k
Error in creating index with smo
Sep 14 2011 8:26 AM
hi friends I am going to create index on my database which contains different column like sal,age.But i got an error failedoperationexception error in index creation.
fail to create index "Id_Index".my code is
SqlConnection con =
new
SqlConnection(
@"Data Source=MAHESH-F7B2934C\BABA;Initial Catalog=te;Integrated Security=True;Pooling=True"
);
ServerConnection sc =
new
ServerConnection(con);
Server srv =
new
Server(sc);
try
{
Database db = srv.Databases[
"te"
];
Table tb =
new
Table(db,
"QRHDQ1"
);
if
(tb != null)
{
Index id =
new
Index(tb,
"Id_index"
);
id.IndexKeyType = IndexKeyType.DriPrimeryKey;
IndexedColumn indexedcol =
new
IndexedColumn(id,
"id"
,
true
);
id.IndexedColumns.Add(indexedcol);
id.IsClustered =
true
;
id.Create();
}
Reply
Answers (
1
)
Why an extension is added while publishing a site
Convert datatable into list