Using SQL Server to establish a database Hovertree
Then use the following script to create the table Hovertree_usermessage
Use [hovertree]go/****** object:table [dbo]. [Hovertree_usermessage] ******/set ansi_nulls ongoset quoted_identifier ongocreate TABLE [dbo]. [Hovertree_usermessage] ([Hvtid] [int] IDENTITY (null,[hvttitle) [nvarchar] (+) null,[hvtcontent] [nvarchar] (max) Null,[hvtuser] [ NVARCHAR] [null,[hvttime] [datetime] null,[hvtreply] [nvarchar] (max) null,[hvtisshow] [bit] null,constraint [pk_ Hovertree_usermessage] PRIMARY KEY CLUSTERED ([Hvtid] ASC) with (Pad_index = off, Statistics_norecompute = off, ignore_dup_ KEY = OFF, allow_row_locks = on, allow_page_locks = on) on [PRIMARY]) on [Primary]goalter TABLE [dbo]. [Hovertree_usermessage] ADD CONSTRAINT [Df_hovertree_usermessage_hvttime] DEFAULT (GETDATE ()) for [Hvttime]go
Then C # uses the Keleyisqlhelper class to add data to the database code:
C # code
String m_sql= "INSERT into Hovertree_usermessage (Hvttitle,hvtcontent,hvtuser) VALUES (" +sqltools.getquotes ( Txttitle.text) + "," + sqltools.getquotes (txtcontent.text) + "," +sqltools.getquotes (Txtuser.text) + ")"; Keleyisqlhelper.executesql (M_sql);
TextBox controls where Txttitle, Txtcontent, and Txtuser are ASP.