VB.NET 转 C#.NET
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click strWhere = "1=1" Dim i As Integer If Me.CheckedComboBoxEdit1.Text <> "" Then strWhere = strWhere & " and 名称 in (''" For i = 0 To Me.CheckedComboBoxEdit1.Properties.Items.Count - 1 If Me.CheckedComboBoxEdit1.Properties.Items(i).CheckState = CheckState.Checked Then strWhere = strWhere & ",'" & Me.CheckedComboBoxEdit1.Properties.Items(i).Value & "'" End If Next strWhere = strWhere & ") " End If
private void btnOK_Click(object sender, System.EventArgs e) { strWhere = "1=1"; int i; if ((this.CheckedComboBoxEdit1.Text != "")) { strWhere = (strWhere + " and 名称 in (''"); i = 0; (this.CheckedComboBoxEdit1.Properties.Items.Count - 1); if ((this.CheckedComboBoxEdit1.Properties.Items(i).CheckState == CheckState.Checked)) { strWhere = (strWhere + (",\'" + (this.CheckedComboBoxEdit1.Properties.Items(i).Value + "\'"))); } strWhere = (strWhere + ") "); } }
[解决办法]
转换工具