http://www.aspxcn.com/dotnetarticle/login.aspx?id=61
http://www.aspxcn.com/dotnetarticle/login.aspx?id=63

解决方案 »

  1.   

    ......
    string myConnection = 连接数据库!
      sql="select username from users where id="&request("id")
    SqlDataAdapter myCommand = new SqlDataAdapter(sql,myConnection);
      sql2="select username from list where id='"&una&'""
    SqlDataAdapter myCommand = new SqlDataAdapter(sql2,myConnection);建议去看看Quickstart
      

  2.   

    Public Sub dosql(ByRef sqlstr As String)
            Dim myConnection As New SqlConnection(constr)
            Dim mycommand As New SqlCommand
            Try
                mycommand.Connection = myConnection
                mycommand.CommandText = sqlstr
                myConnection.Open()
                mycommand.ExecuteNonQuery()
            Catch ex As Exception
                sqlstr = "wrong:" + ex.Message.ToString
            End Try
            mycommand.Dispose()
            myConnection.Close()
            myConnection.Dispose()
        End Sub