<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Storing Block attribute information in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914221#M78616</link>
    <description>You might want to look at DbConnect in Autocad. It doesn't require programming.</description>
    <pubDate>Wed, 14 Mar 2007 16:15:16 GMT</pubDate>
    <dc:creator>Ed__Jobe</dc:creator>
    <dc:date>2007-03-14T16:15:16Z</dc:date>
    <item>
      <title>Storing Block attribute information</title>
      <link>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914220#M78615</link>
      <description>I am trying to figure out how to develop either an MS Access or SQL database that will store block attributes (make, model, price, electrical/plumbing utilities). Which I could then export to Excel to develop budget and bill of material lists/utility schedules.&lt;BR /&gt;
&lt;BR /&gt;
I'd like to be able to insert a block into a drawing and have the Excel spreadsheet update with the respective attribute information.&lt;BR /&gt;
&lt;BR /&gt;
I'm new to customization/programming and feel like I'm biting off more than I can chew right at the moment.</description>
      <pubDate>Wed, 14 Mar 2007 05:13:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914220#M78615</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-03-14T05:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Block attribute information</title>
      <link>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914221#M78616</link>
      <description>You might want to look at DbConnect in Autocad. It doesn't require programming.</description>
      <pubDate>Wed, 14 Mar 2007 16:15:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914221#M78616</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2007-03-14T16:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Block attribute information</title>
      <link>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914222#M78617</link>
      <description>If you need to read data contents easier yet&lt;BR /&gt;
to use OleDB methods&lt;BR /&gt;
Attached is edited version I've found on this forum&lt;BR /&gt;
See how it will works for you&lt;BR /&gt;
For the testing create the form with DataGridView and add&lt;BR /&gt;
one Button&lt;BR /&gt;
Change database path and table name and fields in &lt;BR /&gt;
connection string&lt;BR /&gt;
Hth&lt;BR /&gt;
&lt;BR /&gt;
~'J'~&lt;BR /&gt;
&lt;BR /&gt;
Imports System.Data&lt;BR /&gt;
Imports System.Data.OleDb&lt;BR /&gt;
Imports ADODB&lt;BR /&gt;
'// Note :&lt;BR /&gt;
'// Add reference to Microsoft ActiveX Data Objects 2.X Library&lt;BR /&gt;
'//&lt;BR /&gt;
Public Class Form1&lt;BR /&gt;
&lt;BR /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;BR /&gt;
        ' Create a connection string&lt;BR /&gt;
        Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\MyData\MyBlocks.mdb"&lt;BR /&gt;
        ' Select fields from table Blocks&lt;BR /&gt;
        Dim sql As String = "SELECT BlockName, TAG1, TAG2, TAG3, TAG4 From Blocks"&lt;BR /&gt;
        ' Create a Connection object and open it&lt;BR /&gt;
        Dim conn As Connection = New Connection&lt;BR /&gt;
        Dim connMode As Integer = ConnectModeEnum.adModeUnknown&lt;BR /&gt;
        conn.CursorLocation = CursorLocationEnum.adUseServer&lt;BR /&gt;
        conn.Open(ConnectionString, "", "", connMode)&lt;BR /&gt;
        Dim recAffected As Object = Nothing&lt;BR /&gt;
        Dim cmdType As Integer = CommandTypeEnum.adCmdText&lt;BR /&gt;
        Dim rs As _Recordset = conn.Execute(sql)&lt;BR /&gt;
        ' Create dataset and data adpater objects&lt;BR /&gt;
        Dim ds As DataSet = New DataSet("$Recordset$")&lt;BR /&gt;
        Dim da As OleDbDataAdapter = New OleDbDataAdapter&lt;BR /&gt;
        ' Call data adapter's Fill method to fill data from ADO&lt;BR /&gt;
        ' Recordset to the dataset&lt;BR /&gt;
        da.Fill(ds, rs, "Blocks")&lt;BR /&gt;
        ' Now use dataset&lt;BR /&gt;
        DataGridView1.DataSource = ds.Tables(0)&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;BR /&gt;
        ' Get data from selected row(s)&lt;BR /&gt;
        For i As Integer = 0 To DataGridView1.Rows.Count - 1&lt;BR /&gt;
            If DataGridView1.Rows.Item(i).Selected Then&lt;BR /&gt;
                For j As Integer = 0 To DataGridView1.Columns.Count - 1&lt;BR /&gt;
                    MsgBox("Row " &amp;amp; i + 1 &amp;amp; ", Column " &amp;amp; j + 1 &amp;amp; " value: " &amp;amp; DataGridView1.Item(j, i).Value.ToString)&lt;BR /&gt;
                Next&lt;BR /&gt;
            End If&lt;BR /&gt;
        Next&lt;BR /&gt;
        Me.Close()&lt;BR /&gt;
        Me.Dispose()&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
End Class</description>
      <pubDate>Wed, 14 Mar 2007 18:07:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914222#M78617</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-03-14T18:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Block attribute information</title>
      <link>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914223#M78618</link>
      <description>Since you say you are new to programming I would recommend using VBA.&lt;BR /&gt;
It is much much easier to learn and understand than any of the .NET languages. Plus you will find that there is a lot more samples and examples of code for what you want to do.</description>
      <pubDate>Thu, 29 Mar 2007 15:11:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/storing-block-attribute-information/m-p/1914223#M78618</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-03-29T15:11:46Z</dc:date>
    </item>
  </channel>
</rss>

