Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1018137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:48:50+00:00 2026-05-16T10:48:50+00:00

Was I was previously messing with Silverlight and RIA, I was using a an

  • 0

Was I was previously messing with Silverlight and RIA, I was using a an ADO.NET Entity Data Model and domain context. I’m teaching myself how to run a stored procedure from RIA, and could not get it to work with the previous setup so I then started to try out using the LINQ to SQL method. I did the following:

  • Added the DBML
  • Drag and dropped my table and example stored proc
  • Saved the DBML and built and rebuilt the solution and project files.
  • Create a Domain Service and attempt to add the dbml.

Here is my DBML
alt text

Here is my error. The Available DataContext/ObjectContext classes list shows up empty. I have rebuilt many times and even have restarted visual studio.
alt text

So here are my questions:

  1. Is there an easy way to do a stored proc with ADO.Net that I was missing therfore I could skip adding a LINQtoSQL class.
  2. Am I missing something really simple to add the dbml class and add a stored proc that way.

CODE

ZipCodeDataClasses.dbml.layout

<?xml version="1.0" encoding="utf-8"?>
<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 11, 8.5" name="ZipCodeDataClasses">
  <DataContextMoniker Name="/ZipCodeDataClassesDataContext" />
  <nestedChildShapes>
    <classShape Id="de7acfae-754b-4577-b227-3a33198fdc95" absoluteBounds="7.125, 2.375, 2, 1.3862939453125">
      <DataClassMoniker Name="/ZipCodeDataClassesDataContext/ZipCode" />
      <nestedChildShapes>
        <elementListCompartment Id="8744ad5e-7b77-4770-911d-6dc963876e40" absoluteBounds="7.14, 2.835, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
      </nestedChildShapes>
    </classShape>
  </nestedChildShapes>
</ordesignerObjectsDiagram>

ZipCodeDataClasses.designer.cs

#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace StoredProcedureTest.Web
{
 using System.Data.Linq;
 using System.Data.Linq.Mapping;
 using System.Data;
 using System.Collections.Generic;
 using System.Reflection;
 using System.Linq;
 using System.Linq.Expressions;
 using System.ComponentModel;
 using System;


 [global::System.Data.Linq.Mapping.DatabaseAttribute(Name="ZIPCODES")]
 public partial class ZipCodeDataClassesDataContext : System.Data.Linq.DataContext
 {

  private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

    #region Extensibility Method Definitions
    partial void OnCreated();
    #endregion

  public ZipCodeDataClassesDataContext() : 
    base(global::System.Configuration.ConfigurationManager.ConnectionStrings["ZIPCODESConnectionString"].ConnectionString, mappingSource)
  {
   OnCreated();
  }

  public ZipCodeDataClassesDataContext(string connection) : 
    base(connection, mappingSource)
  {
   OnCreated();
  }

  public ZipCodeDataClassesDataContext(System.Data.IDbConnection connection) : 
    base(connection, mappingSource)
  {
   OnCreated();
  }

  public ZipCodeDataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
    base(connection, mappingSource)
  {
   OnCreated();
  }

  public ZipCodeDataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
    base(connection, mappingSource)
  {
   OnCreated();
  }

  public System.Data.Linq.Table<ZipCode> ZipCodes
  {
   get
   {
    return this.GetTable<ZipCode>();
   }
  }

  [global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.sp_GetCityByZip")]
  public int sp_GetCityByZip([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ZIP", DbType="NVarChar(10)")] string zIP, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="Return", DbType="NVarChar(26)")] ref string @return)
  {
   IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), zIP, @return);
   @return = ((string)(result.GetParameterValue(1)));
   return ((int)(result.ReturnValue));
  }
 }

 [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ZipCodes")]
 public partial class ZipCode
 {

  private string _City;

  private string _State;

  private int _Zip;

  public ZipCode()
  {
  }

  [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_City", DbType="VarChar(25)")]
  public string City
  {
   get
   {
    return this._City;
   }
   set
   {
    if ((this._City != value))
    {
     this._City = value;
    }
   }
  }

  [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="VarChar(2)")]
  public string State
  {
   get
   {
    return this._State;
   }
   set
   {
    if ((this._State != value))
    {
     this._State = value;
    }
   }
  }

  [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Zip", DbType="Int NOT NULL")]
  public int Zip
  {
   get
   {
    return this._Zip;
   }
   set
   {
    if ((this._Zip != value))
    {
     this._Zip = value;
    }
   }
  }
 }
}
#pragma warning restore 1591
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:48:51+00:00Added an answer on May 16, 2026 at 10:48 am

    I gave up trying to get Stored Procedures to work with Silerlight, however following this guide was the closest I ever came to an actual implementation. I hope it helps.

    http://anhonga.wordpress.com/2010/02/17/using-stored-procedures-with-silverlight-4riapocos-part-ii/

    If you ever find a simple way to get stored procedures implemented let me know, because I am in the middle of rewriting a few hundred procedures in LINQ.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was previously using How can a formcollection be enumerated in ASP.NET MVC? 's
Jeff has previously blogged about using the cache to perform "out of band" processing
I'm using dynamic multilevel hashes from which I read data but also writes data.
Previously I was not using an interface for my generic repository. When I extracted
Previously I was not using an interface for my generic repository. When I extracted
Previously I have asked to strip text from a field and convert it to
Previously, I asked the question . The problem is the demands of our file
Previously, I had a class that wrapped an internal System.Collections.Generic.List<Item> (where Item is a
Previously I've asked about inserting a column into a dataset . I now have
I previously asked how to do this in Groovy. However, now I'm rewriting my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.