.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Synchronous call fails, async OK

Posted By:      Posted Date: October 17, 2010    Points: 0   Category :Sql Server
 

I am using SQL Server 2008 R2 as distrbution server and publication server.

Sql 2008 R2 express as subscription database

Replication is working from the SSIS interface and when using RMO and the SynchronizeWithJob method is used from a VB dotNet interface

When I try to use the SynchronizationAgent.Synchronize() method I get this error message:

The merge process detected a mismatch while evaluating the subscriber partition validation expression. The problem can be resolved by reinitializing the subscription.

It fails at the last line in the following code segment

Here is the code:

subscription =

New MergePullSubscription()

subscription.ConnectionContext = conn

subscription.DatabaseName = subscriptionDbName

subscription.PublisherName = publishe


View Complete Post


More Related Resource Links

Call to "ChooseFont" API function fails

  
Hi all, I'm trying to call ChooseFont function in order to load standard system font dialog instead of .NET FontDialog (which does not support not TrueType fonts and fails with error if I try to choose such font). In C program there no problem to call to this function, but in C# the call fails with CDERR_STRUCTSIZE code (returned by call to CommDlgExtendedError). All structures sizes are equal to those in C declarations. Here is a code (maybe I miss something). Thank you in advance. private const int CF_SCREENFONTS = 0x00000001; private const int CF_EFFECTS = 0x00000100; private const int CF_INITTOLOGFONTSTRUCT = 0x00000040; [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] private struct LOGFONT { public int lfHeight; public int lfWidth; public int lfEscapement; public int lfOrientation; public int lfWeight; public byte lfItalic; public byte lfUnderline; public byte lfStrikeOut; public byte lfCharSet; public byte lfOutPrecision; public byte lfClipPrecision; public byte lfQuality; public byte lfPitchAndFamily; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)] public string lfFaceName; } //structure size in C is equal to 60, so I use int instead of IntPtr [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] private struct CHOOSEFONT { public int lStructSize; public int hwndOwne

async call problem mvc asp.net

  

 I read this article, so i write a small code like below in VS 2010:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace AsyncMVC.Controllers
{
    [HandleError]
    public class HomeController : AsyncController
    {
        public void IndexAsync()
        {
            AsyncManager.OutstandingOperations.Increment(2);
            MyTimer timer1 = new MyTimer();
            timer1.FirstEvent += (sender, e) =>
            {
                AsyncManager.Parameters["intid"] = e.id;
                AsyncManager.OutstandingOperations.Decrement();
            };
            timer1.Start1();

            MyTimer timer2 = new MyTimer();
            timer2.SecondEvent += (sender, e) =>
            {
                AsyncManager.Parameters["stringid"] = e.id;
                AsyncManager.OutstandingOperations.Decrement();
            };
            timer2.Start2();

        }

        public ActionResult IndexCompleted(int intid, string stringid)
        {

            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }

    public class MyEventArgs1 : EventArgs
    {
      

WCF async call return a 10054 error: "An existing connection was forcibly closed by the remote host"

  

Hello!

I have a WCF consumed by a Windows Mobile 5.0 or above application with .NET Compact Framework 2.0 SP2 and C#.

When the application consume a asynchronous "method" it throws that message. This is also the stackTrace of inner exception:

at System.Net.Sockets.Socket.ReceiveNoCheck()
at
System.Net.Sockets.Socket.Receive()
at
System.Net.Connection.Read()
at
System.Net.HttpWebRequest.fillBuffer()
at
System.Net.HttpWebRequest.getLine()
at
System.Net.HttpWebRequest.parseResponse()
at
System

Web service call fails on Windows 7

  

I have a Windows application written in C# using .NET 2.0 and Visual Studio 2005. I develop on a Windows XP machine. The application makes web service calls over SSL. To support SSL, I have to install WSE 3.0 on the development machine.

When I run my app on an XP machine it works perfectly and makes web service calls to an SSL enabled web service after I set the following registry entry to a non-zero value:

DWORD Value = zero Value = nonzero
UseScsvForTls  Client sends Renego Info extension for TLS  protocol  Client sends SCSV for TLS  protocol

 

 

The problem occurs when I run the app on a Windows 7 machine. The web service call fails with the following error:

 

The underlying connection was closed: An unexpected error occurred on a send.-   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)

   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)

   at Mic

Cross-database sp call fails

  

A procedure in one database calls a procedure in another:

create proc dbo.sp1
 with execute as owner
as
begin
 exec db2.dbo.sp2
end

When I execute this, I get:

Msg 916, Level 14, State 1, Procedure sp1, Line 3
The server principal "MYDOM\SQLService" is not able to access the database "DB2" under the current security context.

MYDOM\SQLService is the owner of both databases.  It is an admin account.  If I sp_changedbowner to a different account, then that account appears in the error message.

The cross-db call works fine on the production server.  I restored a backup from production to a test server.  It fails on the test server.  A copy of the target database "DB2" also exists on the test server  I've reset the user mapping and reset the database owner on both databases.  What do I need to do to fix this?


Web service call fails on windows 7 with LSP

  

Hi,


I am facing connectivity issue from windows 7 client developed in dotnet 2.0 to a webservice which is developed in dotnet 2.0 and hosted in windows 2003 server. The error I am getting is,


"Error Message: Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section."

For a specific functionality, the client has to function with Layered Service Provider (LSP)
This LSP will be automatically installed in the windows 7 client while installing the Agent kit. I suspect the issue is because of LSP .

 

Client (Windows 7)   :

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

Using jQuery to directly call ASP.NET AJAX page methods

  
Here I am looking to explain how to call page methods using jQuery. Using jQuery to directly call ASP.NET AJAX page methods

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

How to call an .exe file in .net

  
Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.

ToggleDebugCompilation fails trying to perform "an unauthorised operation"

  

Hi,

We're having a problem with the Visual Studio 2008 RTW version of the web deployment projects on a colleagues machine. The project works fine if I run it on my machine, but when he tries to run it on his machine he gets:

<SNIP : Most output removed>
  Task "Exec"
    Command:
    if exist ".\TempBuildDir\" rd /s /q ".\TempBuildDir\"
  Done executing task "Exec".
  Using "ToggleDebugCompilation" task from assembly "C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.Tasks.dll".
  Task "ToggleDebugCompilation"
    Updating Web.config <compilation> element debug attribute to 'True'.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error : Attempted to perform an unauthorized operation.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: The "ToggleDebugCompilation" task failed unexpectedly.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: System.ArgumentNullException: Parameter "message" cannot be null.
    C:\Program Files\MSBuild\Microsoft\WebDeployment

ArrayList.ToArray fails!

  

In my app, I have code similar to the following:

          try

          {

               ArrayList alStartFrames = new ArrayList();
                byte[] abytTest = { 1, 2 };

                alStartFrames.Add(abytTest);

                byte[] abytCombinedFrame = (byte[])alStartFrames.ToArray(typeof(byte));
            }

            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

The call to ToArray always fails and the exception is caught even though I'm pretty sure alStartFrames is an array list of byte arrays. Anyone have any insight on why this is happening?! TIA

Easy Async: Build Concurrent Apps From Simple F# Expressions

  

In this article, the author explores how the F# language helps you create asynchronous function libraries that can be called seamlessly from any other .NET-compliant language.

Chance Coble

MSDN Magazine October 2008


Call MOM: Instrument and Monitor Your ASP.NET Apps Using WMI and MOM 2005

  

The current version of Windows Management Instrumentation (WMI) satisfies many current and future manageability requirements. In this article Michael Jurek demonstrates how WMI provides important system management capabilities and develops a WMI-aware monitoring solution you can use to instrument your ASP.NET applications. He then introduces the capabilities of MOM 2005 that allow you to monitor these instrumented applications.

Michael Jurek

MSDN Magazine September 2005


Advanced Basics: Doing Async the Easy Way

  

If you've been following Ted Pattison's excellent series of Basic Instincts columns on multithreading and asynchronous behavior, you should by now be an expert on handling the issues involved in working with multiple threads in Windows®-based apps.

Ken Getz

MSDN Magazine March 2005


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend