GetOleDbSchemaTable Table Column Schema from JET MS Access

Public Sub GetDatabaseTableColumns()
Try
Dim table As DataTable
Using cn As New OleDb.OleDbConnection(My.Settings.conStrOneWay)
cn.Open()
Dim restrictionValues As String() = New String() {Nothing, Nothing, "Quotes", Nothing}
table = cn.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Columns, restrictionValues)
cn.Close()
End Using

Call DisplayData(table)

Catch ex As Exception
Throw ex
End Try
End Sub

Private Sub DisplayData(ByVal table As DataTable)
For i = 0 To table.Rows.Count - 1
Dim msg As String = table.Rows(i)!COLUMN_NAME.ToString & vbTab & table.Rows(i)!DATA_TYPE.ToString
Console.WriteLine(msg)
Debug.Print(msg)
Next i
End Sub

 

 

Advertisements

Code Generation using System.CodeDom

 
 
Create a code generation project.
For instance to create a class automatically from a database table. Successfully done this in VB.Net Project "CodeGeneration"
 
Now use to quickly create classes for RAD – Rapid Application Development
 
 
 
Found adding a blank line difficult. Answer is here
 

Dim blankLine As New CodeSnippetTypeMember("")
targetClass.Members.Add(blankLine)
 

When creating the Property Set Statements I have found that the Set does not include the (ByRef value as string) part.
However when using the class for the first time, just press return after the Class name and all of these are inserted automatically.

Steve

 
 

New Laptop / PC Specification Ideas

 
Notes from Dave Williams
 
7200 rpm disk or more
Bus speed 800 Mhz ?
RAM high as possible
Blue Ray ?
 

Delegate Test

 

Imports Microsoft.VisualBasic.CallType

Public Class TestJump
Inherits Test

Delegate Sub T()

Public Overrides Sub RunTest()

Try
'Call TestBack()
Dim st As New StackFrame
Me.Name = st.GetMethod.ReflectedType.Name
Dim op As T = AddressOf TestBack
op.Invoke()
Call TestDelegate(AddressOf TestMe.TestBack)
Me.Result = True

Catch ex As Exception
Me.Result = False
Me.FailMessage = ex.Message
End Try

End Sub

Private Sub TestDelegate(ByVal op As T)
op.Invoke()
End Sub

End Class

Module TestMe
Public Sub TestBack()
Debug.Print("Here123")
'Debug.Close()
End Sub
End Module

Talking about NULLABLE datagridviewcomboboxcolumn (vbnet 2005)

 
 
Unresolved
Untried
How to allow used to remove an entry from a DataGridViewComboBoxColumn
 
Possibly try
 
 

Talking about 7-Zip

 

Quote

7-Zip

RAR files etc.

Talking about Scott Hanselman’s Computer Zen – Scott Hanselman’s 2009 Ultimate Developer and Power Users Tool List

Refactor: Anonymous Type to Class

 

Dim RCO As Object = New With {.ID = 1, .Name = "ABC", .Value = 0.123}

Then use Refactor to name the anonymous type and create a class based on it.

 
 

Forms Designer does not show: Value does not fall within the range expected

 
Very frustrating bug this one.
May be that the .resx file is corrupt. In particular the "Other" section, which is the tray locations
 
A way of getting the form back is to close Visual Studio and then reopen
 
Have not tried this.
 
This suggests
1. Go to Windows Explorer and make a copy of the bad forms .RESX file.
2. In the Solution Explorer, click the Show All Files button.
3. Your form should have a + beside it.  Click it and the .resx should show. Make a copy of the .resx file.
4. Right click on the .resx and delete it.
5. Close the IDE.
6. Restart VS and load your project, the .resx should be ok.
 
 

sp_rename

 
 

B. Renaming a column

The following example renames the TerritoryID column in the SalesTerritory table to TerrID.

USE AdventureWorks;
GO
EXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN';
GO