Use Sql Server to create 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 ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[hovertree_usermessage]( [hvtId] [int] IDENTITY(1,1) NOT NULL, [hvtTitle] [nvarchar](500) NULL, [hvtContent] [nvarchar](max) NULL, [hvtUser] [nvarchar](50) 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] GO ALTER TABLE [dbo].[hovertree_usermessage] ADD CONSTRAINT [DF_hovertree_usermessage_hvtTime] DEFAULT (getdate()) FOR [hvtTime] GO
Then the C# code for using the KeleyiSQLHelper class to add data to the database is:
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);
where txtTitle, txtContent, and txtUser are ASP.NET TextBox control