我有以下代码:
<?php
$video_id = "10153231379946729";
$xml = file_get_contents('http://graph.facebook.com/' . $video_id);
$result = json_decode($xml);
$small = $result->format[0]->picture;
$medium = $result->format[1]->picture;
//fetch the 720px sized picture
$large = $result->format[3]->picture;
?>
<img src="<?php echo $medium;?>">
我如何以编程方式计算数据网格中我显示值的行数?
答案 0 :(得分:1)
如果正在填充的DataTable
尚未包含任何行,您可以使用以下方式获取计数:
int count = sda.Fill(ds, "MY TABLE FROM DB")
否则,您可以使用:
访问DataTable
中的行
int count = ds.Tables("MY TABLE FROM DB").Rows.Count
答案 1 :(得分:0)
您可以使用ds.Tables[0].Rows.Count
答案 2 :(得分:0)
Dim ds As New DataSet
Dim sda As System.Data.SqlClient.SqlDataAdapter
Dim sSQL As String
Dim strCon As String
sSQL = " .... MY QUERY HERE .... "
strCon = appBase.dbConnString
sda = New System.Data.SqlClient.SqlDataAdapter(sSQL, strCon)
Dim num_rows=sda.Fill(ds, "MY TABLE FROM DB")
MessageBox.Show(num_rows.ToString())
dgRecordsContent.DataSource = ds.Tables("MY TABLE FROM DB")
dgRecordsContent.DataBind()
dgRecordsContent.Visible = True
dbConn.Close()
请检查此编辑@Emi