Geeks With Blogs

News


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done March 2007 Entries
DataTable.DataTableReader example
public string _LogString_ViaDataReader { get { string x = ""; try { DataTableReader reader = _dsMarkit_log.MARKIT_LOG.Cr... StringBuilder sb = new StringBuilder(); while (reader.Read()) { // Given a DataTableReader, display column names. for (int i = 0; i < reader.FieldCount; i++) { sb.Append("\r\n" + reader.GetName(i) + ": "); if (reader.IsDBNull(i)) { sb.Append("<NULL>"); } else { try { sb.Append(reader.GetValue(i... } catch (InvalidCastException) { sb.Append("<Invalid ......

Posted On Wednesday, March 21, 2007 12:47 PM

c# regex email address
original artickle: http://www.cambiaresearch.c... public bool TestEmailRegex(string emailAddress) { // string patternLenient = @"\w+([-+.]\w+)*@\w+([-.]\w... // Regex reLenient = new Regex(patternLenient); string patternStrict = @"^(([^<>()[\]\\.,;:\... + @"(\.[^<>()[\]\\.,;:\... + @"((\[[0-9]{1,3}\.[0-9]{1,3... + @"\.[0-9]{1,3}\])|(([a-zA-Z... ......

Posted On Friday, March 16, 2007 11:18 AM

create and myTable_Audit via for myTable, where myTable autoIdentity column name is myTable_ID
create and myTable_Audit via for myTable, where myTable autoIdentity column name is myTable_ID Steps: 1) Paste script below into Query Analyzer 2) set Query Analyzer results to "text" (not "grid" 3) set @v_Tablename = 'myTableName' below 4) set @v_postfix = '_ID' below (not 'myTableName_ID' ) 5) run script with no errors (script produces new script) 6) paste text results (new script) into query Query Analyzer 7) run script with no errors new table and triggers created Set NoCount On Go declare @v_Tablename ......

Posted On Thursday, March 15, 2007 10:47 AM

fiinding a substring like "ON" (or with wildcard <.> like ".N" in a bigger string like "YONDER"
Private Function PassesSubstringTest(ByVal myWord As String, ByVal myFragment As String, ByVal matchType As MatchType) As Boolean If myWord = "REDON" Then System.Diagnostics.Debug.Pr... End If '--------------------------... 'anything to do? '--------------------------... If myFragment = "" Then '--------------------------... 'no, return "matched: ......

Posted On Wednesday, March 14, 2007 10:27 AM

Add a column to a table unless it already exists
original article: http://www.cryer.co.uk/bria... To add a column to a SQL Server database table, checking first that the column does not already exist: if not exists (select * from syscolumns where id=object_id('<table_nam... and name='<column_name>') alter table <table_name> add <column_name> <column_definition> where: <table_name> is the name of the table, <column_name> is the name of the column and <column_definition> ......

Posted On Thursday, March 1, 2007 6:34 AM

Copyright © Rodney Vinyard | Powered by: GeeksWithBlogs.net