News

Coders 4 Charities is live!!!
Add to Technorati Favorites

My Stats

  • Posts - 46
  • Comments - 118
  • Trackbacks - 33

Twitter












Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Image Galleries


Blogs I read


Company Links


Fun Stuff


Kansas City User Groups


My CMS Projects


April 2008 Entries

Coders4Charities | Event wrap-up


c4c-bar

Well, it was a great weekend! 25 developers showed up to help out 5 charities, and each charity ended up with an awesome implementation. I've already written the main C4C Event Wrap-Up on the C4C site, as well as wrap-ups for each of the charities.

The event write-up, as well as the write-ups for each charity can be found on the news page of the C4C site.



The 5 charities who were helped this weekend are:

Many thanks (again!) to all those who showed up to develop, volunteer, and donate their time to this amazing event!

 

posted @ Tuesday, April 29, 2008 9:20 AM | Feedback (0) |


Coders4Charities | The Teams


These are the final teams who volunteered this weekend at the Coders4Charities event.

Many thanks to all who showed up to help!


Charity Name
: Boy Scout Troop 813
Needs: A basic website to announce activities, give information, and promote Scouting. We would like to be able to update it remotely by authorized users. We must follow BSA guidelines to ensure we protect the identity of our Scouts.

Team Lead: Lee Brandt
Team Members:

  • Becky Isserman
  • Blake Theiss
  • Joe Loux
  • Timothy Wright


Charity Name
: Berean Bible Church
Needs: The Berean Bible Church would like to have a membership tracking web application built to be able to keep an up-to-date list of members and regular attendees of the church and relevant information about each member.

Team Lead: Steven Hildreth
Team Members:

  • Jill Kirkpatrick
  • Joseph Cook
  • Jim Heavey
  • Kevin Shaffer

Charity Name: Metropolitan Organization to Counter Sexual Assault (MOCSA)
Needs: MOCSA would like their web site to be enhanced. They will benefit from a CMS such as Graffiti CMS or DotNetNuke.

Team Lead: Patrick Herrington
Team Members:

  • David Rogers
  • Buck Sommerkamp
  • Alex Sommerkamp 
  • Cody Inman
  • Rashid Hoda

Charity Name: Missouri Pit Bull Rescue (MPR)
Needs: Needs: MPR would like a new look for their web, more professional-looking, and easy maintenance. They will benefit from a CMS such as Graffiti CMS or DotNetNuke.
Team Lead: Tim Hibbard
Team Members:

  • Hong Chen 
  • James Clemons
  • Yuriy Lyeshchenko

Charity Name: Task Force Omega of Missouri, Inc.
Needs
: New web site. They currently have a MySpace page. Need to support eCommerce functionality for online donations.

Team Lead: Shawn Mannen
Team Members:

  • Jason Atcheson
  • Jacob Dubin
  • Joe Seaman
  • Mary Stayton

 

posted @ Sunday, April 27, 2008 10:06 AM | Feedback (1) |


Coders4Charities | Under Way!


c4c-bar It is day one (well, night one) of Coders4Charities, and the teams are off and running. We had a few no-shows, but we managed to do some last-minute re-arranging and load balancing, and it seems that every team is equally loaded. At last check, they were all involved in requirements gathering, and they're trying to determine what solutions will work for them.

 

 

The charities that are here tonight are:

  • Metropolitan Organization to Counter Sexual Assault
  • Boy Scout Troop 813
  • Berean Bible Church
  • Missouri Pit Bull Rescue
  • Task Force Omega

 

posted @ Friday, April 25, 2008 8:41 PM | Feedback (0) |


How to query a stored procedure for input parameters in .NET


I have a stored procedure that I want to call from my VB.net code. The problem is that the stored procedure input parameters may change. Rather than recompiling the stored procedure, and recompiling the assembly that calls the stored procedure, I want my VB.net assembly to query the stored procedure for its parameters, and return them back to me in a list.

I've done some blog searches for this, and I couldn't find anything that did anything like this (or my search terms were not explicit enough).

UPDATE (thanks to Bill Minton): below, I mention using the sp_helptext functionality in SQL, which is a pain. I've left the original code at the end of this post for posterity. Bill left a comment on this post that uses the following SQL functionality: select parameter_name from information_schema.parameters where specific_name = 'YourProcName'

Below is the code that uses this functionality to get back a List(Of String) with the parameters. I just coded it without testing it, so you may need to work on it a bit (I'm working on something else higher priority at the moment).

   1: Public Shared Function GetStoredProcParams(ByVal spName As String, ByVal dataAction As Aptify.Framework.DataServices.DataAction) As List(Of String)
   2:     Dim reader As SqlDataReader
   3:     Dim params As New List(Of String)
   4:  
   5:     ' build the SQL query
   6:     Dim sql As String = String.Format("select parameter_name from information_schema.parameters where specific_name = '{0}'", spName)
   7:     Try
   8:         reader = dataAction.ExecuteDataReader(sql)
   9:         While reader.Read
  10:             params.Add(reader.GetString(0))
  11:         End While
  12:         reader.Close
  13:     Catch ex As Exception
  14:         Return Nothing
  15:     End Try
  16:  
  17:     Return params
  18: End Function
Thanks again to Bill!

 

Old way:

I've written  VB.net solution to this, which pretty much makes a call to SQL's sp_helptext stored procedure, and parses through the parameter list until it reaches [what it thinks is] the end.

This code works for my needs, but there may be a few bugs for single-parameter stored procs or different stored procedure definitions. My goal is to give a starting point to anyone else out there who is in the same boat as me, but doesn't want to spend the hour or two doing the proof-of-concept.

That being said... here's the code... Let me know if you have any questions. Note that I didn't code out the SQL connection info; you'll need to code that yourself.

 

   1: Public Shared Function GetStoredProcParams(ByVal spName As String) As List(Of String)
   2:     Dim sql As String = String.Format("sp_helptext {0}", spName)
   3:     Dim ds As DataSet = dataAction.GetDataSet(sql)
   4:     ' get the first two rows from the DataSet
   5:     ' (you can keep appending more rows to the spText string if you have a lot of input parms)
   6:     Dim spText As String = ds.Tables(0).Rows(0).Item(0)
   7:     spText += ds.Tables(0).Rows(1).Item(0)
   8:  
   9:     ' we should have the sp definition, with all of the input parameters
  10:     ' pull out the create proc statement
  11:     spText = spText.Replace(String.Format("CREATE PROC {0}", spName), "")
  12:  
  13:     ' now we need to parse out the params themselves
  14:     Dim startIndex As Integer, endIndex As Integer
  15:     Dim params As New List(Of String)
  16:     Dim param As String
  17:  
  18:     While True
  19:         ' find the @
  20:         startIndex = spText.IndexOf("@")
  21:         If startIndex <= 0 Then
  22:             Exit While
  23:         End If
  24:         ' trim away anything to the left of the @
  25:         spText = spText.Substring(startIndex, spText.Length - startIndex)
  26:         ' find the space after the param
  27:         endIndex = spText.IndexOf(" ")
  28:         ' get the param name
  29:         param = spText.Substring(0, endIndex)
  30:         ' add to list
  31:         params.Add(param)
  32:         ' rip out that param we just found
  33:         spText = spText.Substring(endIndex, spText.Length - endIndex)
  34:         ' look for the next @, to see if it's a param, or just sql code down stream
  35:         startIndex = spText.IndexOf("@")
  36:         ' look for a comma, to see if there are more params listed
  37:         endIndex = spText.IndexOf(",")
  38:         ' if the comma comes after the param, this is the last param
  39:         If endIndex > startIndex Then
  40:             ' this is the last parm left
  41:             Exit While
  42:         End If
  43:  
  44:     End While
  45:  
  46:     Return params
  47: End Function

posted @ Tuesday, April 01, 2008 11:19 AM | Feedback (4) |