怎么调试才能知道变量有没有取到值呢?
我在用vs.net 2005 vb.net做一个网站,前台代码中其中有一句: <%=theTitle %> 怎么调试才能知道这个变量有没有取到值呢?,我直接按F5没有报错,但也没有显示这个变量,搞不清了,各位高手讲讲vs的调试吧,越详越好,要是能远程演示下就更好了,qq:164106387
[解决办法]
那就
response.write(theTitle)
response.end
[解决办法]
改成下面这样试试 :
If Trim(codestr) <> " " Then
StrCnn = "server=localhost;uid=as;pwd=;database=myweb "
Cnn = New SqlConnection(StrCnn)
Cnn.Open()
sql = "select * from book_info where id= " & Trim(codestr)
Cmd = New SqlCommand(sql, Cnn)
DataR = Cmd.ExecuteReader
If DataR.Read() Then
theTitle = DataR( "title ")
Response.Write( "theTitle设置了值 ")
Response.End()
theContent = DataR( "content ")
theAuthor = DataR( "author ")
theCopyFrom = DataR( "copyfrom ")
theAddTime = DataR( "addtime ")
Else
Response.Write( "theTitle没有设置值 ")
Response.End()
Cnn.Close()
Response.Write( " <font color= 'gray '> 请选择文章! </font> ")
Response.End()
End If
Cnn.Close()
Else
Response.Write( "theTitle没有设置值 ")
Response.End()
End If