This is my first time to write, and please give us more advice
Only watched a day of csharp on dumb to try, reference the NGWS help document, wrote a message board applet.
This program uses SQL SERVER7, there are only 4 fields in the library:
[Guestbook]
book_id
UserName
Post_time
Content
Because of the CSharp master is not good, write a bit messy, in fact, many places can write a simple point. The output data can be used in different ways, I used the
The server has its own control repeater to output, and can also read data in a getstring way. There are a lot of places worth studying, oh, huh.
In addition to the data check, Microsoft's document said there is a server-side check control, in fact, there are several, very complex, too much e-wen, I still
Look, if you have any experience, you might as well teach me.
By the way, there are a lot of wrong things in the NGWS document, damn it! :(
<%@ Import namespace= "System"%>
<%@ Import namespace= "System.Text"%>
<%@ Import namespace= "System.Data"%>
<%@ Import namespace= "System.Data.SQL"%>
<% @page responseencoding= "gb2312"%>
<script language= "C #" runat= "Server" >
void Page_Load (Object semder, EventArgs e) {
SqlConnection myconnection = new SqlConnection
("Server=sowen;uid=guestbook;pwd=guestbook;database=guestbook");
SqlDataReader myreader;
if (request.querystring["action"]== "Del") {
String delcmd = "Delete from guestbook Where book_id=" + request.querystring["book_id"];
SQLCommand Mydelcommand = new SQLCommand (delcmd.tostring (), myconnection);
MyDelCommand.ActiveConnection.Open ();
Mydelcommand.execute (out myreader);
message.innerhtml = "<B> Delete message! </B> ";
MyDelCommand.ActiveConnection.Close ();
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.