IDE:VS 2008,平台:.NET 3.5,
嗨,
这是我的DataTable列:
ID注意细节
我想这样写:
//below code block is not the right syntax
For each q in dtDataTable.Column("Detail")
strDetail = Row of Column Detail
Next
Run Code Online (Sandbox Code Playgroud)
任何人都可以给我一个建议,并告诉我一个代码示例吗?谢谢.
我只想问两个关于OOP的快速问题.
首先,OOP语言编译器实际生成的代码是否与过程语言编译器有什么不同?我的意思是,OOP只是关于你如何编写代码,还是实际编译的代码与程序不同?像C这样的更精确的过程语言基本上会产生类似于ASM编写的代码.但是OOP代码有什么不同吗?
第二,如果OOP代码在其机器代码形式中使用不同的方法,它是否比程序更慢或更快?谢谢.
我的MS图表类型列有问题.如果图表中有超过9个条形,则axis-x标签将无法正确显示,其中一些标签将消失.
这是我对图表的加价:
<asp:Chart ID="chtNBAChampionships" runat="server">
<Series>
<asp:Series Name="Championships" YValueType="Int32" Palette="Berry" ChartType="Column" ChartArea="MainChartArea" IsValueShownAsLabel="true">
<Points>
<asp:DataPoint AxisLabel="Celtics" YValues="17" />
<asp:DataPoint AxisLabel="Lakers" YValues="15" />
<asp:DataPoint AxisLabel="Bulls" YValues="6" />
<asp:DataPoint AxisLabel="Spurs" YValues="4" />
<asp:DataPoint AxisLabel="76ers" YValues="3" />
<asp:DataPoint AxisLabel="Pistons" YValues="3" />
<asp:DataPoint AxisLabel="Warriors" YValues="3" />
<asp:DataPoint AxisLabel="Mara" YValues="4" />
<asp:DataPoint AxisLabel="Saza" YValues="9" />
<asp:DataPoint AxisLabel="Buha" YValues="6" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
Run Code Online (Sandbox Code Playgroud)
只有9个棒它可以工作,但我不知道它为什么失败超过9个柱.有没有办法让图表正常工作?另外,如果可能的话,如何让每个酒吧都有不同的颜色?
当我点击执行ajax请求的函数时,我正在查看firebug中的控制台.问题是,只需单击一个按钮就可以发送1个ajax请求,但我发送了2个请求!
我的js的代码如下所示:
$(document).ready(function() {
$('.book_now').click(function(){
$.ajax({
type: 'POST',
url: '/booking.php',
data: 'event_id='+event_id+'&time_id='+time_id,
success: function(data) {
console.log('inside');
$('#booking_box_content').html(data);
}
});
});
});
Run Code Online (Sandbox Code Playgroud)
哪个看起来很直接吧?
然而,在我的控制台中,我看到1次点击后出现2次GET请求.
我的按钮很简单:
<div class="book_now"></div>
Run Code Online (Sandbox Code Playgroud)
我错过了什么 - 应该有2个GET请求吗?
是否有机会在加载新文件时再次加载$(document).ready()函数并再次执行click函数?
注意:我不是双击按钮.它可能没关系,但是如果我将它改为POST,它也会做两次.
编辑:来自booking.php的回复
<div id="booking_box_left">
<h1 class="speaker_name"></h1>
<h1 class="event_name"></h1>
<div class="event_start_header">Start</div><div id="event_start_datetime">, </div>
<div class="cleared"></div>
<div class="event_end_header">End</div><div id="event_end_datetime">, </div>
<div class="cleared"></div>
<div class="event_where_header">Where</div><div id="event_where"><strong></strong><br /><br />
</div>
</div>
<div id="booking_box_right_container">
<form id="booking_form_1" method="post">
<input type="hidden" name="booking_id" value="7a614fd06c325499f1680b9896beedeb" />
<input type="hidden" name="event_id" value="" />
<input type="hidden" name="time_id" value="" />
<div id="booking_box_right">
<h1>To …
Run Code Online (Sandbox Code Playgroud) 我有以下代码:
Dim i As Integer = dtResult.Rows.Count
For i = 0 To dtResult.Rows.Count Step 1
strVerse = blHelper.Highlight(dtResult.Rows(i).ToString, s)
' syntax error here
dtResult.Rows(i) = strVerse
Next
Run Code Online (Sandbox Code Playgroud)
我想strVerse
在当前行中添加一个.
我究竟做错了什么?
我有一个搜索关键字然后返回DataTable的函数.我想检查里面是否有行,因为有时候找不到查询.
'which one shoud I use ?
If dtDataTable Is Nothing Then
'some code
lbl_count.Text = "Found 0 result"
End If
If dtDataTable.Rows.Count > 0 Then
'some code
lbl_count.Text = "Found " & dtDataTable.Rows.Count.ToString & " results"
End If
Run Code Online (Sandbox Code Playgroud)
谢谢.
我有一个用MS Chart创建的图表,如下图所示.如您所见,垂直线与每个条形顶部的值混淆.
alt text http://img46.imageshack.us/img46/3720/chartimgaxd.png
这是图表的标记:
<asp:Chart ID="chtNBAChampionships" runat="server">
<Series>
<asp:Series Name="Championships" YValueType="Int32" ChartType="Column" ChartArea="MainChartArea" IsValueShownAsLabel="true">
<Points>
<asp:DataPoint AxisLabel="Celtics" YValues="17" />
<asp:DataPoint AxisLabel="Lakers" YValues="15" />
<asp:DataPoint AxisLabel="Bulls" YValues="6" />
<asp:DataPoint AxisLabel="Spurs" YValues="4" />
<asp:DataPoint AxisLabel="76ers" YValues="3" />
<asp:DataPoint AxisLabel="Pistons" YValues="3" />
<asp:DataPoint AxisLabel="Warriors" YValues="3" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
Run Code Online (Sandbox Code Playgroud)
我不希望显示垂直线,因为它与每个条顶部的值搞混了.如何禁用垂直线?
谢谢.
我想用SQL7和win7手机开发我的应用程序.我正在寻找一个可以与Windows 7手机和SQLite配合使用的ORM映射器.
我正在创建一个使用Linqfor数据访问的页面,我正在使用DataList来显示数据.我如何使用Linq进行数据分页?请阅读以下简单代码:
我通常使用PagedDatasource,但这似乎只适用于DataTable.
这是我的Linq返回与Datalist绑定的Datatable:
公共共享函数GetStudentList()作为DataTable
Dim db As New DemoDataClassesDataContext()
Dim query = From st In db.students _
Order By st.st_studentid Ascending _
Select st
Dim dtStudent = New DataTable("myst")
dtStudent.Columns.Add("st_id", GetType(Integer))
dtStudent.Columns.Add("st_userid", GetType(Guid))
dtStudent.Columns.Add("st_studentid", GetType(Integer))
dtStudent.Columns.Add("st_firstname", GetType(String))
dtStudent.Columns.Add("st_lastname", GetType(String))
dtStudent.Columns.Add("st_gender", GetType(String))
dtStudent.Columns.Add("st_email", GetType(String))
For Each q In query
dtStudent.Rows.Add(New Object() {q.st_id, q.st_userid, q.st_studentid, q.st_firstname, q.st_lastname, q.st_gender, q.st_email})
Next
Return dtStudent
End Function
Run Code Online (Sandbox Code Playgroud)
在页面后面的代码中:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack() Then
LoadData() …
Run Code Online (Sandbox Code Playgroud)