DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    2

    Help Converting a String Value to a GUID

    I have a form which holds values formatted as GUID's. When the form is submitted the selected value from the drop down list is inserted into a SQL table and should hold the uniqueidentifier value type. However because the value from the form is a string i am having trouble matching data types...

    Does anyone know how to convert a properly formated string to a guid.

    Here is the actual code where the parameter is being set up for the stored procedure.

    VB Source Code
    addVideoDA.SelectCommand.Parameters.Add("@zoneid", SqlDbType.UniqueIdentifier).Value = SelectZoneID.SelectedValue

    I am fairly new to asp.net and could use all the help i can get.

    Thanks in advance
    Jeremy

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Try this:

    addVideoDA.SelectCommand.Parameters.Add("@zoneid", SqlDbType.UniqueIdentifier).Value = New Guid(SelectZoneID.SelectedValue)
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    May 2006
    Posts
    2

    thanks

    thanks... that did the trick...

Similar Threads

  1. Input string was not in a correct format
    By mdengler in forum ASP.NET
    Replies: 0
    Last Post: 11-26-2002, 02:32 PM
  2. Replies: 1
    Last Post: 06-05-2001, 06:12 AM
  3. How do I detect an FTP timeout?
    By Julian Milano in forum VB Classic
    Replies: 2
    Last Post: 08-11-2000, 12:11 PM
  4. Please help me -- urgent -- deadlock error
    By chandra in forum VB Classic
    Replies: 0
    Last Post: 06-22-2000, 07:36 AM
  5. Database problems
    By Robert Rieth in forum VB Classic
    Replies: 1
    Last Post: 04-11-2000, 03:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links