- 积分
- 174
- 明经币
- 个
- 注册时间
- 2011-4-18
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我自定义个命令,命令中需要操作(读取)外部数据库中的数据。可是调试中出现错误:Application does not support Windows Forms just-in-time (JIT) debugging.(这个错误是在AutoCAD中输入命令后出现的)请问有遇到过的吗?
具体代码:
<CommandMethod("nettext")> Public Sub nettext()
Dim conn As OleDbConnection
conn = New OleDbConnection("Provide.Microsoft.Jet.OLEDB.4.0;" & "Data Source=E:\database\Bdata.mdb")
conn.Open()
Dim mySQL As String
Dim mytablename As String
mytablename = "桥梁"
mySQL = "select * from " & mytablename
Dim cmd As New OleDbCommand(mySQL, conn)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds, "桥梁")
Dim datarow As DataRow
Dim pt As New Point3d(100, 100, 0)
Dim height As Double = 50
Dim oblique As Double = 0
For Each datarow In ds.Tables("桥梁").Rows
Dim i As Integer = 1
Dim text As String
text = datarow.Item("桥名")
ModleSpace.AddText(pt, text, height, oblique)
pt = New Point3d(100 + i * 500, 100, 0)
i += 1
Next
End Sub
代码意图是在图纸上隔500显示数据库中的桥名。
|
|