Insert returning in Visual Studio

I would like to run an 'insert into .... returning X' query from a C# program in Visual Studio (2003, sigh). How do get the value of X back from the query?
Andrea

Unless it is a Microsoft question you are asking look up the RETURNING clause here.
If it is a Microsoft issue ... ask Microsoft.

Similar Messages

  • Unable to see function return values in Visual Studio 2013 debugger

    Hi!
    I can't see function return values in
    Microsoft Visual Studio Ultimate 2013
    Version 12.0.31101.00 Update 4
    Microsoft .NET Framework
    Version 4.5.51650
    Installed Version: Ultimate<o:p></o:p>
    as described in  http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/27/seeing-function-return-values-in-the-debugger-in-visual-studio-2013.aspx
    So what can I do to get this functionality back?
    MsdnMezzo

    Hi MsdnMezzo,
    Reference:
    http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/27/seeing-function-return-values-in-the-debugger-in-visual-studio-2013.aspx
    If use the same sample in the above blog provided by you, how about the result? Could you debug it with the same steps? I could debug it in my side using the VS2013.
    So to make sure that whether it is your VS IDE issue, please debug it with this sample, if it works well, I doubt that we would think about your specific project and the debugging steps.
    If so, to really repro this issue, could you share us a sample with one drive? You could upload your project to one drive and share us the downloaded link in your new reply, I will download and repro this issue in my side.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • When trying to run a Visual Studio 2010 program under Task Scheduler, it always gives a return code of 3762507597.

    I am trying to run a Visual Studio 2010 program under Task Scheduler. We were running the program under Scheduled Tasks
    in Windows XP with no problems. When it runs under Task Scheduler it always gives a return code of 3762507597. If I run
    the program out of Task Scheduler it runs fine. Running Task Scheduler as Administrator and running the program with
    Run with highest privileges.. Any help or suggestions would be appreciated....  Thanks

    Hi,
    Could you let us know the exact error message? How did you configure it?
    Please follow this guide to check your settings:
    Use the Task Scheduler to Launch Programs Without UAC Prompts
    http://www.7tutorials.com/use-task-scheduler-launch-programs-without-uac-prompts
    Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Karen Hu
    TechNet Community Support

  • Visual Studio Integrate REST Api - WIQL request returns status 400 (Bad Request)

    Hi,
    I'm attempting to submit a WIQL (Work Item Query Language) request to the Visual Studio Online REST api but receiving a status code 400 (Bad Request).
    I'm using the sample request of the first example "Run a query" of the reference documentation listed here: http://www.visualstudio.com/en-us/integrate/reference/reference-vso-work-item-wiql-vsi
    I've taken the sample request: https://fabrikam.visualstudio.com/DefaultCollection/Fabrikam-Fiber-Git/_apis/wit/wiql?api-version=1.0-preview.2 and substituted "fabrikam" with our account and "Fabrikam-Fiber-Git" with our team project
    name.
    I've used the exact same query listed for the sample request:
      "query": "Select [System.WorkItemType],[System.Title],[System.State],[Microsoft.VSTS.Scheduling.Effort],[System.IterationPath] FROM WorkItemLinks WHERE Source.[System.WorkItemType] IN GROUP 'Microsoft.RequirementCategory' AND Target.[System.WorkItemType]
    IN GROUP 'Microsoft.RequirementCategory' AND Target.[System.State] IN ('New','Approved','Committed') AND [System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward' ORDER BY [Microsoft.VSTS.Common.BacklogPriority] ASC,[System.Id] ASC MODE (Recursive, ReturnMatchingChildren)"
    Couple of things that I've tried:
    1. I've tried both "api-version=1.0-preview.2" and "api-version=1.0-preview.1"
    2. I've left out the project name from the request url: Based on the query format listed in the example "https://{account}.visualstudio.com/defaultcollection/[{project}/]_apis/wit/wiql?api-version={version}" I'm assuming that the wrapping of the
    project section in the url in square brackets ([{project}/]) indicates that this section is optional.
    3. I've tried a simpler query:
     "query": "Select [System.WorkItemType],[System.Title],[System.State],[Microsoft.VSTS.Scheduling.Effort],[System.IterationPath], [Microsoft.VSTS.Common.BacklogPriority] From WorkItems"
    Any help would be greatly appreciated.
    Kind Regards,
    Morné

    Hello Morne,
    Visual Studio Integrate forum is for questions about Visual Studio extension development. Yours seems to be about Visual Studio Online REST API to query something. Maybe
    Visual Studio Online forum is better, I'm not sure.
    I move it to [where is this forum for ...] forum, where the moderator will direct you to the right forum.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Errors in visual studio webpage code (Trying to connect the website to a database)

    I am trying to create a website on (visual studio) and connect it to database(Microsoft sql server 2014) first I am learning from a video on youtube the tutorial is about a coffee website and database
    I have a few errors but I dont know where is the problem
    the errors in this page(Coffee.aspx.cs)
    Error    1    Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).    C:\Users\Ziyad 1\Documents\Visual Studio
    2013\WebSites\MyWebsite\Pages\Coffee.aspx.cs    7    33    MyWebsite
    Error    4    'ASP.pages_coffee_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override    c:\Users\Ziyad 1\AppData\Local\Temp\Temporary ASP.NET Files\root\e78a0b4c\be391a08\App_Web_k4b10ys2.0.cs  
     572    
    Error    3    'ASP.pages_coffee_aspx.GetTypeHashCode()': no suitable method found to override    c:\Users\Ziyad 1\AppData\Local\Temp\Temporary ASP.NET Files\root\e78a0b4c\be391a08\App_Web_k4b10ys2.0.cs  
     567    
    Error    5    'ASP.pages_coffee_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable'    c:\Users\Ziyad 1\AppData\Local\Temp\Temporary ASP.NET Files\root\e78a0b4c\be391a08\App_Web_k4b10ys2.0.cs  
     185    
    and here is the page (Coffee.aspx.cs) code
    using System;
    using System.Collections;
    using System.Text;
    namespace Pages
    public partial class Pages_Coffee : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    FillPage();
    private void FillPage()
    ArrayList coffeeList = ConnectionClass.GetCoffeeByType(DropDownList1.SelectedValue);
    StringBuilder sb = new StringBuilder();
    foreach (Coffee coffee in coffeeList)
    sb.Append(
    string.Format(
    @"<table class='coffeeTable'>
    <tr>
    <th rowspan='6' width='150px'><img runat='server' src='{6}' /></th>
    <th width='50px'>Name: </td>
    <td>{0}</td>
    </tr>
    <tr>
    <th>Type: </th>
    <td>{1}</td>
    </tr>
    <tr>
    <th>Price: </th>
    <td>{2} $</td>
    </tr>
    <tr>
    <th>Roast: </th>
    <td>{3}</td>
    </tr>
    <tr>
    <th>Origin: </th>
    <td>{4}</td>
    </tr>
    <tr>
    <td colspan='2'>{5}</td>
    </tr>
    </table>", coffee.Name, coffee.Type, coffee.Price, coffee.Roast, coffee.Country, coffee.Review, coffee.Image));
    lblOuput.Text = sb.ToString();
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    FillPage();
    also tis is the page (Coffee.aspx)code
    <%@ Page Title="" Language="C#" MasterPageFile="~/Masterpage.master" AutoEventWireup="true" CodeFile="Coffee.aspx.cs" Inherits="Coffee" %>
    <script runat="server">
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    </script>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
    Select a type:<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="sds_type" DataTextField="type" DataValueField="type" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
    </asp:DropDownList>
    <asp:SqlDataSource ID="sds_type" runat="server" ConnectionString="<%$ ConnectionStrings:CoffeeDBConnectionString %>" SelectCommand="SELECT DISTINCT [type] FROM [coffee] ORDER BY [type]"></asp:SqlDataSource>
    </p>
    <p>
    <asp:Label ID="lblOutput" runat="server" Text="Label"></asp:Label>
    </p>
    </asp:Content>
    this is th (ConnectionClass.cs)code
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Collections;
    using System.Configuration;
    using System.Data.SqlClient;
    public static class ConnectionClass
    private static SqlConnection conn;
    private static SqlCommand command;
    static ConnectionClass()
    string connectionString =
    ConfigurationManager.ConnectionStrings["coffeeConnection"].ToString();
    conn = new SqlConnection(connectionString);
    command = new SqlCommand("", conn);
    public static ArrayList GetCoffeeByType(string coffeeType)
    ArrayList list = new ArrayList();
    string query = string.Format("SELECT * FROM coffee WHERE type LIKE '{0}'", coffeeType);
    try
    conn.Open();
    command.CommandText = query;
    SqlDataReader reader = command.ExecuteReader();
    while (reader.Read())
    int id = reader.GetInt32(0);
    string name = reader.GetString(1);
    string type = reader.GetString(2);
    double price = reader.GetDouble(3);
    string roast = reader.GetString(4);
    string country = reader.GetString(5);
    string image = reader.GetString(6);
    string review = reader.GetString(7);
    Coffee coffee = new Coffee(id, name, type, price, roast, country, image, review);
    list.Add(coffee);
    finally
    conn.Close();
    return list;
    (web.confg)code
    <?xml version="1.0"?>
    <configuration>
    <appSettings/>
    <connectionStrings>
    <clear/>
    <add name="coffeeConnection"
    connectionString="Data Source=LOCALHOST\SQLEXPRESS;Initial Catalog=CoffeeDB;Integrated Security=True"
    providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
    <compilation debug="true" targetFramework="4.0">
    <assemblies>
    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
    </compilation>
    <authentication mode="Windows"/>
    </system.web>
    </configuration>
    and finally this is the SQL code
    GO
    CREATE TABLE [dbo].[coffee](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [name] [varchar](50) NOT NULL,
    [type] [varchar](50) NOT NULL,
    [price] [float] NOT NULL,
    [roast] [varchar](50) NOT NULL,
    [country] [varchar](50) NOT NULL,
    [image] [varchar](255) NULL,
    [review] [text] NOT NULL,
    PRIMARY KEY CLUSTERED
    [id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    SET IDENTITY_INSERT [dbo].[coffee] ON
    INSERT [dbo].[coffee] ([id], [name], [type], [price], [roast], [country], [image], [review]) VALUES (1, N'Café au Lait', N'Classic', 2.25, N'Medium', N'France', N'../Images/Coffee/Cafe-Au-Lait.jpg', N'A coffee beverage consisting strong or bold coffee (sometimes espresso) mixed with scalded milk in approximately a 1:1 ratio.')
    INSERT [dbo].[coffee] ([id], [name], [type], [price], [roast], [country], [image], [review]) VALUES (2, N'Caffè Americano', N'Espresso', 2.25, N'Medium', N'Italy', N'../Images/coffee/caffe_americano.jpg', N'Similar in strength and taste to American-style brewed coffee, there are subtle differences achieved by pulling a fresh shot of espresso for the beverage base.')
    INSERT [dbo].[coffee] ([id], [name], [type], [price], [roast], [country], [image], [review]) VALUES (3, N'Peppermint White Chocolate Mocha', N'Espresso', 3.25, N'Medium', N'Italy', N'../Images/coffee/white-chocolate-peppermint-mocha.jpg', N'Espresso with white chocolate and peppermint flavored syrups.
    Topped with sweetened whipped cream and dark chocolate curls.')
    INSERT [dbo].[coffee] ([id], [name], [type], [price], [roast], [country], [image], [review]) VALUES (4, N'Irish Coffee', N'Alcoholic', 2.25, N'Dark', N'Ireland', N'../Images/coffee/irish coffee.jpg', N'A cocktail consisting of hot coffee, Irish whiskey, and sugar, stirred, and topped with thick cream. The coffee is drunk through the cream.')
    SET IDENTITY_INSERT [dbo].[coffee] OFF
    I am still a beginner ~~ I need to understand what are these errors and how to solve them

    Hello,
    Welcome to MSDN forum.
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Because your issue is about website, I suggest that you can consult your issue on ASP.NET forum:
    http://forums.asp.net/
     for better solution and support.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Oracle Client 10g Express Edition (ADO, C++, Visual Studio 2008)

    OS: Windows XP SP2
    I made a test programm allowing to work with Oracle 10g Express Edition. Connection with server works, commands are followed, but at the exit from function wmain Visual Studio it buzzez (слышал такое, если нет, то посмотри по другому словарю?) for some time (around 5 minutes) and module mistake crt0dat.arises in __crtExitProcess. function.
    You can have a look at the mistake here: http://img365.imageshack.us/img365/2125/oravssi1.jpg
    Where the mistake can be?
    Connections with MSSQL и MySQL servers work without problems with the stated algorithm.
    #ifndef _WIN32_WINNT
         #define _WIN32_WINNT 0x0501
    #endif
    #include <Windows.h>
    #ifdef _DEBUG
         #define _CRTDBG_MAP_ALLOC
         #include <crtdbg.h>
    #else
         #define _RPTW0
         #define _RPTW1
         #define _CRT_ERROR 1
    #endif
    #import "c:\Program Files\Common Files\system\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")
    INT wmain(INT iArgC, PWCHAR pwcArgV[])
         // COM init
         if (S_OK != CoInitializeEx(NULL, COINIT_MULTITHREADED))
              _RPTW0(_CRT_ERROR, L"CoInitialize");
              return -1;
         // DB connect
         _ConnectionPtr pCnn;
         while (TRUE)
              if (S_OK != pCnn.CreateInstance(__uuidof(Connection)))
                   _RPTW0(_CRT_ERROR, L"pCnn.CreateInstance");
                   break;
              try
                   _bstr_t strCnn(L"DRIVER={Oracle in XEClient};dbq=PORTAL:1521/XE;uid=zorkey;pwd=******;");
                   pCnn->Open(strCnn, L"", L"", adConnectUnspecified);
              catch (_com_error& e)
                   _RPTW1(_CRT_ERROR, L"pCnn->Open (%s)", e.Description().GetBSTR());
              try
                   //pCnn->Execute(L"INSERT INTO ZORKEY_COMPUTER(COMPUTERID, COMPUTERNAME) VALUES(2, 'TEST')", NULL, adConnectUnspecified);
              catch (_com_error& e)
                   _RPTW1(_CRT_ERROR, L"pCnn->Execute (%s)", e.Description().GetBSTR());
              if (adStateOpen != pCnn->GetState())
                   break;
              break;
         // DB close
         if (NULL != pCnn)
              if (adStateClosed != pCnn->GetState())
                   pCnn->Close();
              pCnn.Release();
         CoUninitialize();
         return 0;
    }Formatted code can be seen at http://rafb.net/p/Rvz1wL74.html

    You are right. You should use OCCI 11g to work with VS2008. Download the compatible libraries from here: http://www.oracle.com/technology/tech/oci/occi/occidownloads.html

  • Different row counts between SQL management studio and Visual Studio

    Hi
    I'm pulling data from a NAV database using a stored procedure containing a Pivot (due to bad table design), the problem is my SQL management studio is returning 53 rows of records yet Visual studio is only returning 5.
    I initially copied the query from management studio into VS to create my dataset, however after returning very few records I used a stored procedure instead.
    Unfortunately the same result occurred, 5 records instead of 53,
    Is there something different between the two systems, perhaps VS doesn't like something in the Pivot?
    Can anyone help?
    Thanks
    Charlie
    CREATE
    PROCEDURE [dbo].[PosReleaseTestPrepared]
    --@Date AS DATETIME
    AS
    BEGIN
    -- -- SET NOCOUNT ON added to prevent extra result sets from
    -- -- interfering with SELECT statements.
    -- SET NOCOUNT ON;
    --    -- Insert statements for procedure here
    DECLARE @cols
    NVARCHAR(MAX),
    @stmt NVARCHAR(MAX)
    SELECT        @cols
    =
    ISNULL(@cols
    +
    +
    + ES.Code
    +
    FROM          
    (SELECT       
    Code
    FROM            dbo.[Branston
    Live$Enquiry Step]
    WHERE        [Enquiry Code]
    =
    'PREPARED')
    AS ES
    SELECT        @stmt
    =
        SELECT *
        FROM
        (SELECT PR.[Entry No_], PR.[Mobile User Code], PR.[Failure Step Code],PR.[Item No_], PR.[Customer No_] ,[Enquiry Step Code],  Value
         FROM dbo.[Branston Live$Positive Release] PR
          LEFT OUTER JOIN dbo.[Branston Live$Positive Release Step] PRS
           ON PR.[Entry No_] = PRS.[Positive Release Entry No_]
         WHERE PR.[Enquiry Code] = ''PREPARED'') PR
         PIVOT
          MAX(VALUE)
          FOR [Enquiry Step Code] in ('
    + @cols
    +
         ) AS P'
    EXEC
    sp_executesql@stmt
    END
    GO

    Hi Satheesh, Latheesh
    I'm using a shared data source in VS, the server and database are definitely pointed to the right location. As is the Stored procedure/SQL query. The table names "PositiveRelease" are bespoke to us and therefore are easy to recognise.
    Below is one of the 5 records from the VS report:
    Mobile   User Code
    Customer   No 
    Item   No 
    Failure Step Code
    Depot   Date
    PP_GY
    102980
    S10586
    DEPOT_DATE
    17/02/14
    Below is the record from the SQL management studio, you can see it is pulling through matching records.
    Mobile User Code
    Customer No_
    Item No_
    Failure Step Code
    DEPOT_DATE
    PP_GY
    102980
        S10586
    DEPOT_DATE
    17/02/2014

  • Error on Form Designer on Visual Studio 2012

    Dear Sir,
    I have used Visual Studio 2012 to develop my project for a long time.
    However, suddenly Designer of all Forms come an error but the system can compile the project.
    Therefore, I am not able to change the design of the Form in Visual Studio.
    Any Suggestion?
    Thank you very much.
    The following is the Error of the Designer:
    To prevent possible data loss before loading the designer, the following errors must be resolved:
    1 Error
    The type 'System.Configuration.UserScopedSettingAttribute' could not be found. Ensure that the assembly containing the type is referenced. If the assembly is part of the current development project, ensure that the project has been built.
    Instances of this error (1)
    1. Hide Call Stack
    at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
    at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetType(String name, Boolean throwOnError)
    at Microsoft.VisualStudio.Shell.Design.VirtualTypeBuilder.FillAttributes(Resolver resolver, CodeTypeMember member, Attribute[]& customAttributes, MemberAttributes& memberAttributes)
    at Microsoft.VisualStudio.Shell.Design.VirtualTypeBuilder.InitializeFromType(ITypeResolutionService typeResolutionService, CodeTypeDeclaration typeDecl, String namespaceName)
    at Microsoft.VisualStudio.Shell.Design.VirtualTypeBuilder.InitializeFromType(ITypeResolutionService typeResolutionService, CodeNamespace ns)
    at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.BuildType()
    at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.GetObjectType()
    at Microsoft.VisualStudio.Shell.Design.GlobalType.get_ObjectType()
    at Microsoft.VisualStudio.Shell.Design.GlobalObject.GetHashCode()
    at System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T obj)
    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
    at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.TrackGlobal(GlobalObjectProvider p, GlobalType g)
    at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects(Type baseType)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetTypeFromGlobalObjects(String name, Boolean throwOnError, Boolean ignoreCase)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name)
    at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.GetType(String typeName)
    at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
    at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
    Best regards,
    Felix

    Hello Felix,
    The info seems tell us your project is corrupt. May I ask this question, will this error reproduce when you create a new simple project? This can be divided into two scenarios:
    Scenario 1: The new project is also corrupt.
    In that way, your Visual Studio may already corrupt. It's time for you to repair your Visual Studio from control panel.
    If it still not work, try use some common steps below to fix:
    Please open an administrative CMD window and navigate to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE and run these commands:
    1.devenv.exe  /safemode
    2.devenv.exe  /resetskippkgs
    3.devenv.exe  /installvstemplates
    4.devenv.exe  /resetsettings
    5.devenv.exe  /resetuserdata 
    Scenario 2: The new project doesnot get this issue.
    In this way, we should focus on this "The type
    'System.Configuration.UserScopedSettingAttribute' could
    not be found"
    See here from MSDN to know how we can use it in our code:
    https://msdn.microsoft.com/en-us/library/system.configuration.userscopedsettingattribute(v=vs.110).aspx
    Check whether your code list something like below code and check whether you have missed anything here.
    //Application settings wrapper class
    sealed class FormSettings : ApplicationSettingsBase
    [UserScopedSettingAttribute()]
    public String FormText
    get { return (String)this["FormText"]; }
    set { this["FormText"] = value; }
    [UserScopedSettingAttribute()]
    [DefaultSettingValueAttribute("0, 0")]
    public Point FormLocation
    get { return (Point)(this["FormLocation"]); }
    set { this["FormLocation"] = value; }
    [UserScopedSettingAttribute()]
    [DefaultSettingValueAttribute("225, 200")]
    public Size FormSize
    get { return (Size)this["FormSize"]; }
    set { this["FormSize"] = value; }
    [UserScopedSettingAttribute()]
    [DefaultSettingValueAttribute("LightGray")]
    public Color FormBackColor
    get { return (Color)this["FormBackColor"]; }
    set { this["FormBackColor"] = value; }
    Or you can copy your project content to a new fresh project and rebuild your project with new settings.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error in MS Visual Studio 2010 : Conversion failed when converting the nvarchar value '@VATSchemeType' to data type int.

    This worked well in Visual studio 2005, but in the 2010 version it gives the above error
    SELECT VT_ClientCore.ClientCode
     ,VT_VATScheme.SchemeName
          ,CI_Entity.Name as 'Client Name'
          ,SY_Address.Address1
     ,SY_Address.Address2
    ,SY_Address.Address3
     ,SY_Address.Address1
     +(CASE WHEN (Address2 is Null OR Address2 = '') THEN '' ELSE ', ' + Address2 END)
                      + (CASE WHEN (Address3 is Null OR Address3 = '') THEN '' ELSE ', ' + Address3 END)
                      as 'Address123'
    ,SY_Address.City
    ,VT_ClientCore.VATOffice
    ,VT_ClientCore.NatureOfBusiness
    ,SY_Address.PostalCode
    ,SY_Country.Description as 'Country'
    --CASE WHEN (PostalCode IS NULL THEN)
    FROM VT_ClientCore
    LEFT JOIN VT_ClientPack ON VT_ClientCore.EntityCode#ClientCore = VT_ClientPack.EntityCode#ClientCore
    LEFT JOIN VT_VATScheme ON VT_ClientPack.VATSchemeID = VT_VATScheme.VATSchemeID
    LEFT JOIN CI_Entity ON VT_ClientCore.EntityCode#ClientCore = CI_Entity.EntityCode
    LEFT JOIN CI_ENTITYDETAIL ON VT_ClientCore.Entitycode#ClientCore = CI_EntityDetail.EntityCode
    LEFT JOIN SY_Address ON CI_ENTITYDETAIL.AddressID = SY_Address.AddressID
    LEFT JOIN SY_Country ON VT_ClientCore.CountryCode = SY_Country.CountryCode
    --WHERE VT_ClientCore.ClientCode = '23002'
    --AND SY_Address.PostalCode IS NOT NULL
    WHERE CI_ENTITYDETAIL.DETAILTYPE = 'AT'
    AND VT_VATScheme.VATSchemeTypeID IN (@VATSchemeType)
    AND VT_VATScheme.VATSchemeID IN (@VATSchemeID)
    GROUP BY VT_ClientCore.ClientCode,CI_Entity.Name,SY_Address.City,VT_ClientCore.VATOffice,VT_ClientCore.NatureOfBusiness,SY_Address.PostalCode,SY_Address.Address1,SY_Address.Address2,SY_Address.Address3,VT_VATScheme.SchemeName
    ,SY_Country.Description
    --VAT Scheme
    SELECT VATSchemeID,SchemeName
    FROM VT_VATScheme
    WHERE VATSchemeTypeID IN (@VATSchemeType)
    ORDER BY SchemeName

    How are you assigning the value to variable @VATSchemaType? Are you assigning multiple values? if yes, then you need to better join with the values by splitting the values. 
    The below would give an error (just for your reference)
    create table test_one(col1 int)
    Insert into test_one Values(1),(2)
    Declare @inta varchar(10) = '1,2'
    Select * From test_one where col1 in(@inta)
    Select * From test_one where col1 in(Select items From dbo.Split_BigInt(@inta,','))
    Drop table test_one
    function definition:
    create FUNCTION Split_BigInt
    @string VARCHAR(MAX),
    @delimiter CHAR(1)
    RETURNS @results TABLE
    items BigInt
    AS
    BEGIN
    DECLARE @index INT
    DECLARE @temp TABLE (
    items BigInt)
    IF @string = ''
    RETURN
    SET @string = LTRIM(RTRIM(@string))
    SELECT @index = Charindex(@delimiter, @string)
    WHILE @index <> 0
    BEGIN
    INSERT INTO @temp (items)
    VALUES (LTRIM(RTRIM(LEFT(@string, @index - 1))))
    SELECT @string = LTRIM(RTRIM(RIGHT(@string, Len(@string) - @index)))
    SELECT @index = Charindex(@delimiter, @string)
    END
    INSERT INTO @temp (items)
    VALUES (@string)
    INSERT INTO @results (items)
    SELECT items
    FROM @temp
    where
    items <> ''
    RETURN
    END

  • Clobbered by a CLOB - Using C# in Visual Studio 2005

    Hello All,
    What I am trying to do:
    I am trying to insert a string as a CLOB into Oracle via C# using Visual Studio (VS) 2005.
    What I am using:
    The Oracle Tools for VS 2005 are installed and work fabulously with other types of data.
    Research I have done on my own:
    1. I have read the thread "ORA-01461"
    2. Have modified an example (see below) from the Oracle web site
    ..... as noted in the comments below (Jason Price).
    3. Addtionally, there are a number of www references.
    4. However, after a long unproductive day none are working for me.
    Error messages from Oracle (caught by the catch block):
    The error is: Oracle.DataAccess.Client.OracleException ORA-00936: missing expression at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src) at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) at Oracle.DataAccess.Client.OracleCommand.ExecuteReader() at clobSample.workThis() in c:\Documents and Settings\joe.user\My Documents\Visual Studio 2005\WebSites\HDTS\App_Code\clobSample.cs:line 71
    Thank you kind people of the Oracle Community,
    Mark
    *********** Code is Below ***********
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class clobSample
    public clobSample()
    // TODO: Add constructor logic here
    public OracleConnection getConnectionString(string DBuser, string DBpass)
    // Build Connection String
    string connectionString = "Data Source=MY_DATA_SOURCE;User Id=";
    connectionString += DBuser + ";Password=";
    connectionString += DBpass + ";Persist Security Info=True";
    OracleConnection connection = new OracleConnection(connectionString);
    return connection;
    ClobExample4.cs shows how to update a CLOB
    using SELECT ... FOR UPDATE
    public string workThis()
    string strResult = "";
    try
    // create an OracleConnection object to connect to the database and open
    // the connection
    OracleConnection myOracleConnection =
    getConnectionString("DB_USER_NAME", "DB_PASSWORD");
    myOracleConnection.Open();
    // create an OracleCommand object to hold a SQL statement
    OracleCommand myOracleCommand = myOracleConnection.CreateCommand();
    // step 1: create an OracleTransaction object
    OracleTransaction myOracleTransaction =
    myOracleConnection.BeginTransaction();
    // step 2: read the row
    myOracleCommand.CommandText =
    "SELECT TICKET_NUM, COMMENT " +
    "FROM HDTS_TICKET_EVENTS " +
    "WHERE TICKET_NUM = 1 FOR UPDATE";
    // THIS IS WHERE THE CODE ERRORS OUT *
    OracleDataReader myOracleDataReader =
    myOracleCommand.ExecuteReader();
    myOracleDataReader.Read();
    // Console.WriteLine("myOracleDataReader[\"id\"] = " +
    // myOracleDataReader["id"]);
    // step 3: get the LOB locator
    OracleClob myOracleClob =
    myOracleDataReader.GetOracleClob(1);
    // step 4: write to the LOB
    myOracleClob.Erase();
    string text = "Alas poor Yoric, I knew him well";
    char[] charArray = text.ToCharArray();
    myOracleClob.Write(charArray, 0, charArray.Length);
    Console.WriteLine("myOracleClob.Value = " + myOracleClob.Value);
    // step 5: commit the transaction
    myOracleTransaction.Commit();
    // Console.WriteLine("Successfully committed transaction");
    // close the OracleDataReader and the OracleConnection object
    myOracleDataReader.Close();
    myOracleConnection.Close();
    // Console.WriteLine("\nPress any key to end");
    // Console.ReadLine();
    return strResult;
    } // close try
    catch (Exception e)
    strResult = "The error is: " + e;
    return strResult;
    } // close work this
    } // close clobSample class
    Edited by: microBiker on Sep 30, 2008 5:01 AM

    Hi,
    I dont think this has anyting to do with CLOB, but rather the use of a reserved word for a column name.
    How did you get the table created with a field named "COMMENT"? That's a reserved word so you shouldnt use it, even if you can someone force the database to accept it by using quotes for example...
    SQL> select count(*) from v$reserved_words where keyword='COMMENT';
    COUNT(*)
    1
    SQL> create table t1 (comment clob);
    create table t1 (comment clob)
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> create table t1 ("COMMENT" clob);
    Table created.
    SQL> select comment from t1;
    select comment from t1
    ERROR at line 1:
    ORA-00936: missing expression
    I assume the error might be stemming from that, as I see no reason for the code to error.
    Cheers,
    Greg

  • Build Tuxedo service in Visual Studio

    Hi!
    I need to build the executable for a Tuxedo service. The Visual Studio project
    already contains a TuxServer.cp file which has the tpsvrinit function, and tux.c
    which was generated by BuildTuxedo. It also contains a sybesql.c file and other
    codes files. It was a legacy system, and I don't know much about Tuxedo. The machine
    I want to build it on already has Visual Studio, Sybase and Tuxedo installed.
    How do I set up the environment so I can build the exe in Visual Studio itself?
    Thanks,
    Caroline

    Hello and thank you very much for your answers
    Right now I tried RobertH's solution. I'm gona try it also with Coq rouge's link.
    To RobertH's way:
    I inserted the line __declspec(dllexport) unsigned int __stdcall multiply(unsigned char a, unsigned char b);
    and my file looked like this:
    #include "stdafx.h"  __declspec(dllexport) unsigned int __stdcall multiply(unsigned char a, unsigned char b);unsigned int multiply(unsigned char a, unsigned char b) {unsigned int c; c = a * b;return c; }
    When I tried to compile, i got an errormessage:
    error C2373: 'multiply': Neudefinition; unterschiedliche Modifizierer
    in English:
    error C2373 'multiply': redefinition; different modifier
    I could fix this error by editing the line
    unsigned int multiply(unsigned char a, unsigned char b)
    into
    unsigned int __stdcall multiply(unsigned char a, unsigned char b)
    but i have no idea if this is the correct way. Maybe this is wrong? Now i could compile.
    I also could open the function multiply in LabView. I created at the call library function node the inputs and outputs. LabView described the functionprototype as:
    uint16_t ?multiply@@YGIEE@Z(uint8_t a, uint8_t b);
    I could start the programm, but I got a LabView errormessage:
    Error 1097 occurred at Call Library Function Node in extcodetest.vi
    Possible reason(s):
    LabVIEW:  An exception occurred within the external code called by a Call Library Function Node. The exception may have corrupted LabVIEW's memory. Save any work to a new location and restart LabVIEW.
    I tried both calling conventions, c and stdcall 
    At least, i could start the LabView Programm. Thats already a littel success. But i think i will need more help.
    Now I'm also gonna try Coq rouge's link.

  • Access sharepoint list form visual studio

    I am trying to access share point  site as data source in visual studio .I am getting below error.Please help me resolve this error.
    The HTML document does not contain Web service discovery information.
    Metadata contains a reference that cannot be resolved: 'http://cwfsp5/Content Management/Lists/Bookmark Definitions/AllItems.aspx'.
    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
    The remote server returned an error: (401) Unauthorized.
    If the service is defined in the current solution, try building the solution and adding the service reference again.

    var siteUrl = '/sites/MySiteCollection';
    function retrieveListItems() {
    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Announcements');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
    '<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></View>');
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(collListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args) {
    var listItemInfo = '';
    var listItemEnumerator = collListItem.getEnumerator();
    while (listItemEnumerator.moveNext()) {
    var oListItem = listItemEnumerator.get_current();
    listItemInfo += '\nID: ' + oListItem.get_id() +
    '\nTitle: ' + oListItem.get_item('Title') +
    '\nBody: ' + oListItem.get_item('Body');
    alert(listItemInfo.toString());
    function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx

  • Visual Studio 2013 - New Project

    Hi
    Many years ago I wrote a VB6 program for school students for diet analysis in terms of energy and a range of vitamins and minerals.  It drew comparisons against the national guidelines.  Results were tabulated, graphed and output provided in Word
    and Excel files.  The VB6 program used an Access database containing about 850 foods. It has been used by quite a few schools and appears to always be used across a network.
    My intention is to re-write the whole program in Visual Studio 2013 using Visual Basic code.  I intend to refresh the whole program and add a wider range of foods and update the comparisons using the latest national guidelines and food label formats.
    This will be my first attempt at Visual Studio and I intend to use a Windows Forms Application approach.  The data used is "static" - it does not change it is simply a "read only" file - get the data, multiply for mass and add up each
    category (energy, vitamins and minerals).  It is a "file of data" rather than a true database.  In reality a 1000 food data file should only be about 200 Kbytes.  As an Excel file it is only 150Kbytes but as an Access file it is bloated
    up to a 550Kbyte file.
    The program is not sophisticated, so, should I be using a WPF Application or a Window Forms Application?  The WFA just feels a bit more familiar than a WPF.  Also, the program is intended for loading onto a network at some schools or on a stand-alone
    computer.
    My greatest concern is about the choice of approaching the data.  A "true" database is not needed because the data is simply for about 1000 rows of food each with about 20 columns of data (numeric and text).  The Access file is simple
    but I could create an mdf file (I think) but would that be an advantage?  With the Access data I appear to have loaded the file and created a DataAdapter and I have experimented with GetData() which works.  My attempts to use ExecuteReader() failed
    completely.  Is there a better approach?  such as SQL "DataTable.Rows(RowPosition)(“column name")”??  It seems a very sophisticated method for a small file of data.
    The Access Database that I have experimented with in VS2013 appears to use Jet Drivers???? which proved to create a few problems for installations in the past.  Should I be using an mdf file approach??  I will need to distribute the data in a "resx"
    file.  I could use SQL Server Management Studio (free download) and then use VS2013 to read the Access file and build a new mdf database.....
    I am not convinced that I have the best solution.  Any comments and suggestions would be very greatly appreciated.
    Many thanks for reading this far.
    Winchestermili
    Winchestermili

    Frank
    Looking good!  The "attachment" to a new project worked first time.
    I can see all the new Classes by hovering a pointer over the "declarations" above "Public Class Form1"
    Seems to access the VBNetForum URL quite quickly using a high speed BB connection.
    I am greatly looking forward to the next stage...........
    Regards
    Keith
    Winchestermili
    Keith,
    I intentionally truncated that post with “let me know when you’re that far along” simply because it’s very easy to get lost
    with a concept that’s new. This isn’t as different as you might think though – you’ve been using a database, and now you’ll be using instances of a class (various ones).
    Over the years here, I’ve seen many times where people use databases because they assume “that’s the only way to do it”. The
    “it” actually being encapsulation.
    Encapsulation
    is what they need and certainly a database provides that (and a lot more), but it’s not the only way it can be done.
    Think about this a bit: A DataRow encapsulates the related data for whatever it is. For example maybe it’s a person’s data –
    you’d want to keep the person’s first name, surname, and things like that all together because it defines something related to that one person. You then have a collection of those DataRows in a DataTable.
    In much the same way, what I have here is similar: Instead of a DataRow, I’m using instances of a class. Instead of columns
    in a DataRow, I’m using properties of the instance, and instead of a DataTable, I’m using a List(Of Class).
    …the concept is identical.
    Classes are a means of building an object in OOP. In and of itself, it’s really just a template or a blueprint (overused metaphor).
    Deborah Kurata put it best, in my opinion, when she said that a class is like a cookie-cutter and the objects created are cookies. You eat the cookies, not the cookie-cutter!
    A class works that way exactly: You can’t “consume” a class; you consume the objects (instances) created by them and in this
    case, like a DataTable housing DataRows, I’m storing them in a very specific type of collection known as a List(Of T).
    I don’t want to get too far adrift about classes and/or OOP here – not that I would mind the discussion – but it’s a new concept
    to you and it’s easy to get confused about what’s doing what. I’ll get more to the specifics next.
    That entire class library is the data layer; it doesn’t work with controls of any sort, only the data.
    That said though, in the following I’ll explain how controls can be ‘assisted’ by the methods in the classes.
    The main class in this is the one called “FoodComposition”. That one is only barely started – the
    only
    method in it so far is an overloaded way to add a new instance to a list of them.
    Two of the classes are really just ‘supporting classes’ – those being the ones called “FoodCategory” and “LabelNote”. Don’t
    get me wrong here, they do have methods in them (with more to be added), but you won’t too much be working with those in the user’s program – you will in the program that I’ll create for you to add/modify/remove* and so on, but for now let’s set those two
    aside.
    *  The fact that these are “supporting” classes, I have it set up such that you cannot remove an instance of those if there’s
    a reference to them in FoodComposition. If you want to see where/how I’m doing that, look at the code of the class FoodCategory, for example, and go to line 633, then read the code of that method named “Remove”.
    The one class in the bunch which is pretty much self-contained is the one called DietaryReferenceValue (DRV is the name you
    used). That one makes for a good topic to explain how I can provide methods which lend a helping hand to your controls but don’t, directly, have anything to do with controls.
    I have a method in that class named “GetAllGroupNames” which is a function that returns a string array containing the names
    of each instance’s group. That might be used, for example, if you wanted to show a ListBox or a ComboBox to allow the user to select one of the group names:
    Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    Dim url As String = _
    "http://www.fls-online.com/VBNet_Forum/12-13-14/NutritionData.xml"
    GetNutritonData(url)
    ListBox1.Items.AddRange(NutritionData.DietaryReferenceValue.GetAllGroupNames(drvList))
    End Sub
    So, for example, when the user selects one of them:
    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles ListBox1.SelectedIndexChanged
    Try
    If ListBox1.SelectedIndex > -1 Then
    Dim selectedGroup As String = _
    ListBox1.Items(ListBox1.SelectedIndex).ToString
    Dim drv As NutritionData.DietaryReferenceValue = _
    NutritionData.DietaryReferenceValue.GetInstance(drvList, selectedGroup)
    MessageBox.Show(drv.ToString, drv.SexAndAgeGroup)
    End If
    Catch ex As Exception
    MessageBox.Show("An error occurred:" & vbCrLf & vbCrLf & ex.Message, _
    "Program Error", MessageBoxButtons.OK, _
    MessageBoxIcon.Warning)
    End Try
    End Sub
    As you can see there, I’m using the .ToString method which I have overridden in the class. That’s also part of what I wanted
    to discuss: What it gets.
    Currently I don’t have much else (other than maintenance routines like adding, removing, renaming) in there; the methods that
    you use are methods that I set up – but in the words of Hamlet, “therein lies the rub” … I don’t know what you want!
    Give some thought to just what methods you might want to have in there. For example maybe you might want to have a method which
    will return the value of one specific nutrient which you specify. I can do that, I just don’t know yet that you want it so it’s not there.
    Quite often I’ll also provide what I’m come to call “convenience properties”. For example with the property named “Sodium”,
    I might have another property (read-only) named “Sodium_String” which returns a string in whatever format you wanted it to have.
    These are things I don’t know that you want and also things which you may not have known can be done, thus this writing. ;-)
    The other day I asked about units. It may not be where you want to go with this but I’d also like to offer that we can provide
    more granularity to the nutrients themselves. Don’t get me wrong, it’d be an overhaul of what I have right now, but I’ll do it if you want to proceed:
    Imagine that we have a class, all by itself, that we call “Nutrients”. At the very least that class would have members like
    Name and UnitOfMeasure, but it could have anything else you wanted. An example that comes to mind might be the URL to a page on Wikipedia about it, or maybe a URL to an appropriate image or … whatever you dream of here.
    So then when using them in the other classes, “Calcium” would, itself, be an object which has a name (“Calcium”), a unit-of-measure
    (maybe “milligram”), and so on.
    It’s a lot to take in all at once and even this is something you may want to reread, but do give it thought. Let me know what
    methods you want in the classes which will help you in your user’s program.
    Still lost in code, just at a little higher level.

  • Visual Studio Website

    HI,
    Just a preface, I have limited experience with visual basic, and no experience with Visual Studio at all.
    I want to host a website with Visual Studios 2012 from my windows 7 desktop that will take input from the user, do some data manipulation with Excel and another program through visual basic, and then return an Excel file with the processed data to the user.
    Is this possible to do with Visual Studios?
    Thanks
    JD

    Hi JD,
    Thank you for posting in MSDN forum.
    Since this forum is discuss this VS IDE issue, as you said issue, I think that it may be related to the Website application develop. So I suggest you could post this issue directly to the ASP.NET forum:
    http://forums.asp.net/ , you will get better support.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Create a Site Definition file with Visual Web part in Visual Studio

    I tried to create a site definition file in Visual Studio 2013 and SharePoint 2013 by following the MSDN tutorial:
    Walkthrough: Create a Basic Site Definition Project. Near the end, I added a virtual web part control to the site definition and registered MyWebPartControls in the site definition's default ASPX page as written in the MSDN tutorial:
    Unfortunately, IntelliSense doesn't show any MyWebPartControls: tags, and VisualWebPart1 is highlighted with a warning “Element 'SMWebPart3' is not a known element. This can
    occur if there is a compilation error in the Web site, or the web.config file is missing.”
    Since it’s a warning, I went ahead to build and deploy the solution. However, when I used the site definition template to create a subsite, it returned a parser error:
    Unknown server tag 'MyWebPartControls:TestSiteDef1.VisualWebPart1'
    I spent half day researching and debugging, and finally solved the problem. The issue is on the registration line:
    <%@ Register Tagprefix="MyWebPartControls" Namespace="TestSiteDef.VisualWebPart1" Assembly="$SharePoint.Project.AssemblyFullName$" %>
    The $SharePoint.Project.AssemblyFullName$ is a replaceable parameter to provide values for SharePoint solution items whose actual values are not known at design time. Unfortunately, it does not find the right assembly name during the deployment. It should
    be replaced by the Assembly’s Strong Name. Here is how I fixed the problem step by step:
    In Solution Explorer, open the package node and double click Package.package
    Click Manifest tab in the Package.package.
    Copy the full assembly name in the package’s manifest. It may be similar like this:
              Assembly="TestSiteDef,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    Back to the site definition’s default.aspx page, replace the
                     Assembly="$SharePoint.Project.AssemblyFullName"
    in the registration line with the copied text:
    Assembly="TestSiteDef,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    Change the Namespace from
    Namespace="TestSiteDef.VisualWebPart1"
    to
    Namespace="TestSiteDef".
    The line to register the web part in a site definition file will look like this:
    <%@
    Register
    Tagprefix="MyWebPartControls"
    Namespace="TestSiteDef "
    Assembly="TestSiteDef, Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    %>
    Clean, build and deploy the solution. It works like charm. (Note: the warning message on visual web part may still exist, but you can ignore it).

    Assuming your .ascx.vb file is inheriting from the web part class, you can add the custom properties in the same manor (language syntax aside).
    Be sure to use the attributes to correctly identify and scope the properties. (see:
    http://www.sbrickey.com/Tech/Blog/Post/SharePoint_Attributes_for_Web_Part_properties)
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com

Maybe you are looking for

  • Info record not updated from PO , PO updated from Info record

    Dear Gurus, I want to restrict Base price in PO will be copied from Valid info record. User does not permitted to change the Base price once info record not maintained. Kindly tell me the configuration steps to adopt the process ? I don't want to upd

  • Save as package or folder

    I've just opened Logic Pro X for the first time after downloading the additional content, and thought I would try to open a song from Logic Express 7.2. I read this article Logic Pro X: About working with projects from previous versions of Logic, how

  • Problems with date in procedure on Oracle 11g

    Hi gurus, I have some problems with the date format on Oracle 11g. Let me explain the situation: When I am starting a request like select to_number(to_char(to_date('01.04.2009','dd.mm.yyyy'), 'yyyy')) from sys.dual I got as result 2009 as number. Whe

  • How to create a link to a web page that is connected to the database?

    i am developing a web form in java using Oracle's JDeveloper. i created the form which is connected to the database and now i want to put a link in a page that when clicked it shows the form and populates it if necessary. i have no idea how to do tha

  • GR  FOR pur .order  issue

    Hi when i am doing ..GR for puchase order ... system give error  like "value of goods moment is negetive" I Have create purchase order (subcontracting)..me21n..item cat L in pur .ord mention components..in 2 line items 1st line item component issue t