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
Daniel Morais
NA
9
9.7k
c# SQLCE Create Table
Nov 27 2013 3:00 PM
I am using this to create my table is this the way to do it, i Need to link the two tables
/*----------------------------------------------*/
static public void CreateTable()
{
SqlCeConnection cn = new SqlCeConnection(ConnectString());
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
SqlCeCommand cmd;
sql="create table Categories ("
+ "CategoryID INT IDENTITY (1,1) CONSTRAINT pkCategoryID PRIMARY KEY not null, "
+ "Categorie nvarchar(50))";
cmd = new SqlCeCommand(sql, cn);
cmd.ExecuteNonQuery();
sql = "create table Snippets (" + "SnippetsID INT IDENTITY (1,1) CONSTRAINT pkCategoryID PRIMARY KEY not null, "
+ "CategoryID INT REFERENCES Categories(CategoryID), "
+ "SnippetsName nvarchar (50), "
+ "SnippetsContent ntext)";
cmd = new SqlCeCommand(sql, cn);
cmd.ExecuteNonQuery();
cn.Close();
}
Thank's
Reply
Answers (
0
)
PL SQL trigger to restrict employee in department
Read data from MongoDB