vb.net 数据删除问题 急 在线等

来源:百度知道 编辑:UC知道 时间:2024/06/14 21:10:17
Dim sqldel = "delete from info where num='" & Me.t_num.Text & "'"
conn.Open()
da.DeleteCommand.CommandText = sqldel
da.DeleteCommand.ExecuteNonQuery()
conn.Close()
不能实现删除,为啥?

import java.util.Random;
public class Wb3
{
public static void main(String[] args)
{
int[] num = new int[100];
Random rand = new Random();

for(int i=0; i< 100; i++)
{
num[i]=rand.nextInt(10);
}
for(int i=0; i<100; i++)
{
System.out.print(num[i]+" ");

if(((i+1)%10)==0)
{
System.out.print("\n");
}
}
}
}

da.DeleteCommand.CommandText = sqldel
da.DeleteCommand.DataConnection=conn
da.DeleteCommand.ExecuteNonQuery()
试试

Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.SqlClient

Dim cmd As New SqlCommand
Dim conn As New SqlConnection
Dim sqldel = "delete from info where num='" & Me.t_num.Text & "'"
conn.Connection