求把一段简单的VB翻译成C#
<%
Dim s As Integer
Dim V(1000) As String
V = Split(ds.Tables(0).Rows(i)(2), ",")
Dim conn7 As Data.SqlClient.SqlConnection
conn7 = New
System.Data.SqlClient.SqlConnection
conn7.ConnectionString = checkname.sjkconn1()
conn7.Open()
Dim sql7 As Data.SqlClient.SqlCommand
sql7 = New System.Data.SqlClient.SqlCommand
For s = 0 To UBound(V)
sql7.CommandText = "select * from [restaurantslb] with (nolock) where id=" & V(s) & ""
sql7.Connection = conn7
Dim rs7 As System.Data.SqlClient.SqlDataReader
rs7 = sql7.ExecuteReader
If rs7.Read() Then
%>
<td width="10%"><%=rs7(2)%></td>
<%
End If
rs7.Close()
Next
sql7.Cancel()
conn7.Close()
conn7 = Nothing
%>
<td width="10%"><%=ds.Tables(0).Rows(i)("tj")%></td>
<td width="20%">
<%If ds.Tables(0).Rows(i)("tj") = "否" Then%>
<a href="restaurants_tj.aspx?id=<%=ds.Tables(0).Rows(i)(0)%>">推荐</a>
<%else%>
<a href="restaurants_tj.aspx?id=<%=ds.Tables(0).Rows(i)(0)%>">取消推荐</a>
<%end if%> |
<a href="restaurantspic_list.aspx?id=<%=ds.Tables(0).Rows(i)(0)%>&hid=<%=ds.Tables(0).Rows(i)(0)%>">Photos</a>
| <a href="restaurants_edit.aspx?id=<%=ds.Tables(0).Rows(i)(0)%>">编辑</a>
| <a href="restaurants_del.aspx?id=<%=ds.Tables(0).Rows(i)(0)%>" onclick="{if(confirm('确定删除吗?')){return true;}return false;}">删除</a></td>
</tr>
<%
Next
ds.clear
ds.dispose
da.dispose
End If
conn.Close()
conn = Nothing
%>