Posts

Showing posts from February, 2011

Can brush resources be used for customizing states?

hi, i'm trying create 3 states toggle button using pre-existing linear gradient brush. want modify background use linear gradient brush when toggle button checked or on mouse over, can't life of me figure out how blend record transition. if go in manually change background linear gradient records fine - setting background local resource doesn't appear anything. there way this? or missing something?  i'd able use resource colours , brushes set this. i'm wondering - possible have transition go solid brush linear gradient? i'm thinking no since blend wipes out storyboard try that... thanks help! hey, wpf , silverlight support continuous animation color but brush. what can do achieve effect have background of button lineargradientbrush , animate color gradient stops different color resource values. blend should allow animate the color values color resource value. thanks! jeetendra kukreja [msft]

Salesforce connection times out every hour

Image
hi all, for recent project experiencing rather annoying problem. i have get, update or create customers in salesforce.  use salesforce connectors this, works great after while, lets 1-2 hours connection expires , have create whole new salesforce connector. wondering if known issue , if problem inside logicapp or have figure out salesforce why error occurs. i have problem production logic app connections salesforce.  connector throws error randomly.  run fails, seems recover on subsequent re-run. this not seem timeout error, possibly fault in way connector manages tokens, or timing issue in initialization of connector. after break of approx 3 weeks without triggering actions, had 21 logic app runs fired , executed within same minute - 4 failed error, remaining succeeded.  failures ran on next scheduled run 1 hour later. can developers of salesforce connector take look? Microsoft Azure

ESB Toolkit and Windows Identity Foundation (Geneva)

hello, know if possible send messages wcf relying party (wcf service uses federated security) through esb toolkit. if so, receive location should use, , how must configure security settings. can use wcf-wshttp receive location issuedtoken client credential type (can't seem find it), or must use wcf-custom receive location. ideas appreciated. sven i recommend moving question general bts forum more visibility.  toolkit on-ramps bts receive location esb pipeline.  authentication, identity, etc is handled wcf , not esb toolkit.  first thought should supported assuming it configuring type of authentication in binding available in receive location, cannot certain.  if supported through wcf bindings in bts esb toolkit off-ramps should support though since expose wcf-custom or wcf-wshttp configuration includes ability modify binding. thanks, brendon birdoes, neudesic BizTalk Server

how to convert a number into roman numeral in visual C#

how convert number roman numeral in visual c# there's no standard method this, have write it. for example, can try (simple , recursive): public static string toroman(int number) { if ((number < 0) || (number > 3999)) throw new argumentoutofrangeexception("value must between 1 , 3999"); if (number < 1) return string.empty; if (number >= 1000) return "m" + toroman(number - 1000); if (number >= 900) return "cm" + toroman(number - 900); //edit: i've typed 400 instead 900 if (number >= 500) return "d" + toroman(number - 500); if (number >= 400) return "cd" + toroman(number - 400); if (number >= 100) return "c" + toroman(number - 100); if (number >= 90) return "xc" + toroman(number - 90); if (number >= 50) return "l" + toroman(number - 50); if (number >= 40) re

Windows 8 not Working properly on dell N4050 Shahbaz Shareef Laptop

i msp pakistan. have tried windows 8 consumer preview , windows 8 release preview , using windows 8 pro , facing the same problem. problem computer not restart while installing windows or after updates , others problems too. is manufactured problem in 1,25,000 dell n4050 laptops given government of punjab pakistan. serious issue develops , users too. now????  >the computer not restart while installing windows search "restart without installing updates" on answers.microsoft.com >some others problems too ask on answers.microsoft.com if problem related using windows or office features. this forum helping developers in designing their software, not using else's software have no source code for. visual c++ mvp Architecture  >  Architecture General

BizTalk 2009 - Store Subdocument as EDI in Database

i working client using biztalk server 2009 standard edition that processes 837 claims using 4010 multiple schema x12. process uses edireceive pipeline import data. once data "split" xml message, store "split" message field in database, want store "split" message in the edi format, not xml format. is possible convert xml message edi edi formatted message can stored in database? also, should mention not using maps in orchestration. using .net persist database, need associate edi message persisted data before inserting database. have information share? i recommend storing message in custom database rather tracking database because tracking database gets periodically cleaned out. thanks, if answers question, please use "answer" button | ben cline BizTalk Server  > 

External global and named Styles not displaying in Blend at design time

first, i've created dll storing styles, controltemplates, and other resources brushes , fonts.  dll not contain custom controls, within assembly.  assembly strictly control styles.  now, i've set project every control encapsulated 1 xaml file a resourcedictionary ease of organization.  button.base.xaml, tabcontrol.base.xaml, button.green.xaml, etc.  now, in root of project single file named default.xaml, nothing more merge resources together.  have done couple reasons; 1) can merged default.xaml file application.resources merged dictionaries 1 line of code.  2) if ever skinning application, simple changes in brush resources, can create root file called green.xaml or red.xaml, point.  when application starts up, code can determine root xaml file merge application's resources. example of default.xaml in the ui.resources.dll < resourcedictionary         xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"       xmlns: x = "

DTL VM from Managed Image using ARM template

Image
hello, i've created managed image vm created via portal.  i created arm template deploy new vm using image , put vm on existing vnet.  after verified worked correctly added arm template github repository , added repository dtl. when tried deploy server in dtl using arm template received error message (pasted below).  the vnet in same region , subscription dtl.  i have added vnet list of vnets dtl (configuration , policies --> virtual networks). any thoughts on why not able add nic subnet?   templates @ :   https://github.com/eyem4usf/devtestlabs01/tree/master/dtl_arm_templates/serverfrommanageimage error message: if understood correctly, trying bring external managed image devtestlabs, , create vms it. if that’s correct, don’t support right now. can instead managed vm, can hold of underlying vhd , upload lab , create custom image it. onwards can use below arm template, , point customimageid custom image resource id created.

Exposing ConfigurationManager to COM applications

Image
i maintaining classic asp application has numerous values hardcoded throughout entire application.  migrate of hardcoded values out of application , configuration file similar storing configuration values in .config files using .net. my plan create com-visible class library wraps functionality of system.configuration.configurationmanager class retrieving configuration settings standard configuration sections such appsettings, connectionstrings etc.  have been using configurationmanager.appsettings, configurationmanager.connectionstrings etc. method calls in c#.net code retrieve relevant information. however, 1 of issues have encounted classic asp pages have not been able find or locate associated .config files.  know in .net, .config files need match name of assembly dll named myassembly.dll have corresponding .config file named myassembly.dll.config.  however, there no such association between com , .net config files.  therefore, how com libraries appropriately read values .

Unhandlable NullReferenceException in AdMediator on Windows Phone 8.1

using v2.0.5: system.nullreferenceexception unhandled message: unhandled exception of type 'system.nullreferenceexception' occurred in microsoft.admediator.windowsphone81.microsoftadvertising.dll additional information: object reference not set instance of object. that's extent of "copy exception detail clipboard" when exception pops (no symbols available) in vs 2015 ide windows phone 8.1 (winrt) project http://bc3te.ch/brandonh brandon,   how occur , have the callstack?   we're working on fix nullreferenceexception in same dll, i'm thinking it's same issue. shouldn't happen - it's timing issue creation of ad control , when being used. matt Windows and Windows phone apps  >  AdSDK Integration & Ad Mediation

how can i use LZW compression for bitmap images?

Image
hi everybody i see many implementations lzw technique text compression in c#, can use algorithm compress bitmap images , how be? hi zxaseel, thank posting here. for question, download source file from  fast lzw compression using binary tree . the program compress image via lzw compression. i use gif show that. in link, has explanation of  lzw algorithm. i hope helpful. best regards, wendy msdn community support please remember click "mark answer" responses resolved issue, , click "unmark answer" if not. can beneficial other community members reading thread. if have compliments or complaints msdn support, feel free contact msdnfsf@microsoft.com . Visual Studio Languages  ,  .NET Framework  > 

ildasm crash on a C++/CLI DLL

i have compiled delay-signed c++/cli dll run through dotfuscator. during process, dotfuscator runs following command line: "c:\program files\microsoft sdks\windows\v6.0a\bin\ildasm.exe" /out=mydll.dll.il /text /nobar /raweh /quoteallnames /utf8 /linenum /forward mydll.dll this line causes ildasm.exe crash. the thing ildasm.exe crashes same way when manually run command line. what can do??   compiler: vs2005 os: winxp sp3 .net framework: v2.0.50215 dotfuscator: professional edition version 4.2.5005.34681 looking @ symptoms , command line, appears using /linenenum generate il. ildasm crash when remove /lineenum? we've found similar bug may @ play here. can try windows 7 sdk .net sp1 http://www.microsoft.com/downloads/details.aspx?familyid=c17ba869-9671-4330-a63e-1fd44e0e2505&displaylang=en if doesn't work, have fix can try. thanks! chris cooper .NET Framework

Tool Tip

hey, have listbox data added mysql database. how can make when user clicks on or hovers on listbox item small info box pops , shows listbox item content. code using data is:   connection.open(); mysqlcommand updatecommand = new mysqlcommand( "select concat('(',accounts.name,')',' ',updates.posted_update) posted_update updates inner join accounts on updates.user_id = accounts.id order updates.update_id desc limit 0,25" ); updatecommand.connection = connection; dataset updates = new dataset(); mysqldataadapter mysqladapter = new mysqldataadapter(updatecommand); mysqladapter.fill(updates, "updates" ); listbox1.datasource = updates.tables[ "updates" ]; listbox1.displaymember = "posted_update" ; connection.close();   http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.tooltip.aspx   the listboxitem part of frameworkelement heirarchy.  result can set tool tip o

AppConfig

i developing components using c#. have several appconfig, each each of components (since each component have different parameters). have test projects use test each of components, , far ive seen, components able "see" appconfigs belong testprojects, not appconfig have put in each of components. why that? there overcome that? hi can use configurationmanager.openexeconfiguration(file path) load exclusive config files each component. http://dotnetwithme.blogspot.com vikas goyal Architecture  >  Architecture General

How To Validate The Username And Password As Userdefiene Thing I Winform?

i want validate username , password in winformm using visual c#. in program.cs class,  <pre lang="cs"> static void main()         {             application.enablevisualstyles();             application.setcompatibletextrenderingdefault(false);             application.run(new form1());             if(username==abcd amp;&amp; password==abcd)             {                 dialogresult=dialogresult.ok;             }             else             {                 messagebox.show(&quot;invalid username , password);             }         }     } } want validate login page , when enter username "abcd" and  password "abcd" show next form if wrong show message box wrong</pre> hi, for requirement can use code project solution http://www.codeproject.com/articles/13922/validate-user-input-in-windows-forms for real time user validation db can refer http://www.aspsnippets.com/articles/validating

Cross domain web service method access problem

hi, i trying access webservice method on other domain , server i set there authentication mode anonymous but getting error while calling webservice method can me.   nobody can you. you haven't provided information. john saunders wcf is web services. not 2 separate things. use wcf new web service development, instead of legacy asmx or obsolete wse use file->new project create web service projects Archived Forums A-B  >  ASMX Web Services and XML Serialization

The site account manager and/or Authentication provider could not be initialized

after i've updated cs 2002 cs 2007 , asp.net 1.0 2.0 i've got little problem whit new solution. when enter site in global.asx through response.redirect(url) there comes exception says this: an exception of type 'system.exception' occurred in isonet.shop4you.dll not handled in user code additional information: site account manager and/or authentication provider not initialized. if continue page gets displaye if want logon shop there comes exception again (of course when there response.redirect) , things displayed wrongly. login infos saved in cookie , when start page new there failure because system thinks im authorized idont have ane id in commercecontext.currentuser. what's here problem?   thanks   taichimaster wrote: an exception of type 'system.exception' occurred in isonet.shop4you.dll not handled in user code additional information: site account manager and/or authentication provider not initialized. hi there, dll mentioned in error mess

Implement Content-Based Routing Using a Business Rules Policy for a Known Message Type does not work using Samples

Image
hi, i'm new biztalk , esb toolkit, have since tried implement content based routing via esb itinary having problems condition on business rule not evaluating properly, i've been following microsoft example in link below doesn't want work. http://msdn.microsoft.com/en-us/library/ee264380%28v=bts.10%29.aspx when submit request following error, meaning rule has not evaluated. can please help? the map name not provided , required. source: microsoft.practices.esb.pipelinecomponents.dispatcherdisassemble method: void disassemble(microsoft.biztalk.component.interop.ipipelinecontext, microsoft.biztalk.message.interop.ibasemessage) error source: microsoft.practices.esb.itinerary.services error targetsite: microsoft.biztalk.message.interop.ibasemessage executetransform(microsoft.biztalk.component.interop.ipipelinecontext, microsoft.biztalk.message.interop.ibasemessage, system.string, boolean) error stacktrace: @ microsoft.practices.esb.itinerary.services.transform

BAM RTA problem

hi,  we're using bts 2009 , sql 2008. defined rta , deployed. when deployed system on heavy load experienced following error: <event xmlns=" http://schemas.microsoft.com/win/2004/08/events/event "> - <system>   <provider name=" mssqlserverolapservice " />   <eventid qualifiers="49441">3</eventid>   <level>2</level>   <task>289</task>   <keywords>0x80000000000000</keywords>   <timecreated systemtime="2010-08-13t09:13:59.000z" />   <eventrecordid>135902</eventrecordid>   <channel>application</channel>   <computer>xyz</computer>   <security />   </system> - <eventdata>   <data> ole db error: ole db or odbc error: transaction (process id 132) deadlocked on lock resources process , has been chosen deadlock victim. rerun transaction.; 40001. </data>   </eventdata&

Timer is not firing sometimes when handling multithreaded Application

  i facing problem timer not getting fired when application runs minutes. using windows xp sp2 running application .net framework 2.0 the objective of using timer send cyclic message hardware @ periodic interval i using system.timers fires every 2 seconds , processing time involved in elapsed event around 700 milliseconds only. the same tried threading timer , behaviour same. kindly clarify if there solution this?   thanks , sangeetha hard tell description sounds timer object getting garbage collected.  make sure have life reference instance... .NET Framework  >  Common Language Runtime Internals and Architecture

Writing text on success in a batch file

Image
hi , i running basic batch file declare errorlevel @ end of command . i have text instead 1 or 0 (failure or success), know how ??? maybe instead %errorlevel%  ?? the batch file : dtexec /file "m:\ssisprojects\dwh\alm_daily\wmfd2537.dtsx "  /decrypt 1234 /configfile "m:\ssisprojects\dwh\alm_daily\alm_daily_common_config.dtsconfig" /maxconcurrent " -1 " /checkpointing off  /reporting ewcdi  >  m:\ssisprojects\dwh\alm_daily\ecsysout\alm_daily_2537.txt echo %errorlevel% thanks advance , david . if errorlevel==1 echo failure echo success computer hope (batch files) rob van der woude's site talk me on SQL Server  >  SQL Server Integration Services

Beginner Q: Pocket PC access to SQL Server 2005

hi,   total beginner pocket pc, , 2-month beginner sql server 2005 , visual studio 2005.  made database pillbox.mdf, , wrote windows forms program access it.  it's easy.  added data source, chose tables , stored procedures, , dragged them onto forms.  automatically created adapter classes , datagrid me.   next, wanted same thing pocket pc.  did same drag , drop thing, , happy see empty datagrid in emulator (design-time) form.  here on, trouble.  when ran it, said not connect.   so some questions: 1) connection string have change?  has 3 parts: machine name, database name, , security spec.  specifies machine name.  ok?  known pocket pc, or have specify http something?  machine have change settings become "server"?  it's standalone pc no network.  understand emulator chooses pretend it's not "on" computer.  database name known pocket pc?  (same type of question.)  , windows authentication ok on pocket pc?  or must create name/password pair on sql s

High transaction biztalk server jobs can be causing excessive blocking

active active sql cluster biztalk just started looking @ why biztalk /sql server experiencing excessive blocking took @ jobs thinking theses jobs being executed  frequently messagebox_deadprocesses_cleanup_biztalkmsgboxdb enabled yes occurs every 1 day(s), every 1 minute(s) between 12:00 a.m. , 11:59 p.m 00:00.0 00:00.0 36:18.1 messagebox_deadprocesses_cleanup_biztalkmsgboxdb_slave1 enabled yes occurs every 1 day(s), every 1 minute(s) between 12:00 a.m. , 11:59 p.m 00:00.0 00:00.0 36:37.8 messagebox_message_managerefcountlog_biztalkmsgboxdb enabled yes occurs every 1 day(s), every 1 minute(s) between 12:00 a.m. , 11:59 p.m 00:00.0 00:00.0 36:18.2 messagebox_message_managerefcountlog_biztalkmsgboxdb_slave1 enabled yes occurs every 1 day(s), every 1 minute(s) between 12:00 a.m. , 11:59 p.m 00:00.0 00:00.0 36:37.9 messagebox_parts_cleanup_biztalkmsgboxdb enabled yes occurs every 1 day(s), e

BizTalk 2009 MQSeries adapter in 64-bit mode

has installed biztalk 2009 mqseries adapter in 64-bit mode before? technet states possible haven't been able find detailed instructions install process. http://msdn.microsoft.com/en-us/library/aa560166(bts.10).aspx " the mqseries adapter supported in both 32-bit , 64-bit processes. adapter has mqseries agent runs on ibm websphere mq server on windows. mq fix pack 6.0.2.1 agent supported 32-bit process running under wow64." how go configuring mqseries agent run under wow64? nikolai the mqseries adapter (part of biztalk 2009 base) installs fine without wmq running on biztalk server. on several 64-bit servers work on w2k8 r2. if mean mqsc adapter - part of biztalk adapters host systems (bah), should able install wmq software first, biztalk , bah install mqsc adapter show up. have thread going on issue though might check out: http://social.msdn.microsoft.com/forums/en-us/biztalkr2adapters/thread/0544b0cc-2044-499b-a824-5fefde90e77e i think mqseries agent should run under wo

ORA-01460: unimplemented or unreasonable conversion requested

hi i'm triny run oracle stored procedure using wcf lob adapter. the sp has out blob parameter , i'm geting error: the adapter failed transmit message going send port "wcfsendport_downloadattachment.bindinginfo" url "oracledb://xxxxx/". retransmitted after retry interval specified send port. details:"microsoft.servicemodel.channels.common.targetsystemexception: ora-01460: unimplemented or unreasonable conversion requested ---> oracle.dataaccess.client.oracleexception ora-01460: unimplemented or unreasonable conversion requested    @ oracle.dataaccess.client.oracleexception.handleerrorhelper(int32 errcode, oracleconnection conn, intptr opserrctx, oposqlvalctx* poposqlvalctx, object src, string procedure)    @ oracle.dataaccess.client.oracleexception.handleerror(int32 errcode, oracleconnection conn, string procedure, intptr opserrctx, oposqlvalctx* poposqlvalctx, object src)    @ oracle.dataaccess.client.oraclecommand.executenonquery()    @ microsof

Use Methods in more than one static class

hi guys, as topic says i'm having few static classes (they have static) , set of methods use in every static class. the clue is, these methods shall access fields of classes, why (i think) have called within class. is there way use these methods without copy , pasting in each of static classes? thanks simon >>is there way use these methods without copy , pasting in each of static classes? no, not if methods access private fields of class in defined since static class cannot derive class. if have common functionality used in more 1 class, should create non-static base class , put common code in there , create other non-static classes derives base class. makes no sense share class specific funtionality between static classes since static class not related static class. you of course put methods don't operate on class specific fields in static class , access static class , methods other classes.

Get SQL & Exchange Versions from a Console Application

hey all,   i'm looking @ trying exchange version , sql version using console applicatio , have output console. ideas?? you can version of ms sql using sqlconnection sqlconnection = new sqlconnection(connectionstring); microsoft.sqlserver.management.smo.server server = new microsoft.sqlserver.management.smo.server(new microsoft.sqlserver.management.common.serverconnection(sqlconnection)); console.writeline("sql server {0}", server.information.version.major.tostring()); or can use query   select @@version and know version of exchaneg server in computer. you have read registery key in location registry keys in following  registery location, hkey_local_machine\software\microsoft\windows\currentversion\uninstall\micro soft exchange need read registry keys , find out version of exchange server installed. http://msdn.microsoft.com/en-us/libr....registry.aspx   Visu

Biz Talk 2006 R2 HL7 Accelarator

 i tried sample application @ biz talk 2006 r2 consume adt message , send acknowledgement. followed steps specifed @ msdn hl7 developer guide document. not find out hl7 receive pipe line @ biz talk server administration console (receive location). added receive pipeline hl7 receive pipeline in project , deploy. configure port using pipe line specified in doucment. (transport type file). application not accept adt sample message given msdn. tried version 2.3.1 , 2.4 message. message suspended. can me ? my question : 1. hl7 receive , send pipeline available @ biz talk server receive location after installed hl7 accelarator? 2. or should need add this pipeline in our project? 3. here installation problem? sample project given msdn not contain error message 1: uncaught exception (see 'inner exception' below) has suspended instance of service 'bz_hl7.bz_orchestration(eedd17b1-1a49-f570-9543-b2cfccba7bae)'. the service instance remain suspended until administratively resu

DevTest Labs - Example using 'Clone a git repository' artifact with VSTS Git source please...

Image
hi, please can provide example of 'clone git repository' artifact in use. ideally repo should exist within vsts. i'd copy repo root of c drive on vm. i'm getting following error: many thanks phil hi swikruti, many getting me. actual problem turned out bug in artifacts' artifactfile.json file. buggy line: "commandtoexecute": "[concat('powershell.exe -executionpolicy bypass -file startchocolatey.ps1', ' -gitrepolocation ', parameters('gitrepouri'), ' -gitlocalrepolocation ''', parameters('destination'), ''' -gitbranch ', parameters('branch'), ' -personalaccesstoken ', parameters('personalaccesstoken'))]" fixed line: "commandtoexecute": "[concat('powershell.exe -executionpolicy bypass -file startchocolatey.ps1', ' -gitrepolocation ', parameters('gitrepouri'), ' -gitlocalrepolocatio

Custom Infobox in BingMap WPF Control

Image
im trying create custom bingmap pushpin, should somthing problem cannot shape "sticking out" indicate position. have tried but, trainagle whithout sticking corner           <controltemplate x:key="mycustompintemplate1" targettype="m:pushpin">             <grid x:name="contentgrid" horizontalalignment="left"  verticalalignment="center"  >                 <canvas x:name="contentpopup" visibility="visible">                     <rectangle x:name="contentpopuprectangle" fill="aliceblue" opacity="0.7" canvas.left="0" strokethickness="2" stroke="wheat" canvas.top="0" height="50" width="122" radiusx="5" radiusy="5" />                            <stackpanel canvas.left="10" canvas.top="5">                                         <content

Installing and starting Windows Service

maybe isn't right place question but, guess help, or let me know look. i have problem starting windows service. wrote small windows service program, compiled it, , ok. when run installutil tool : installutil ff.exe ends these lines the commit phase completed successfully. the transacted install has completed. which guess ok, when type net start ff i error : the service name invalid. what doing wrong here? tnx! glad got sorted. you might wish set thread resolved. i sure there self resolved somewhere. Archived Forums V  >  Visual C# Language

Strategies in v8 for ensuring that Inboxes open within the bounds of the Map?

after switching v6.3 v8, getting complaints users infoboxes opened pushpins towards top of map cut off, forcing user scroll map "down" in order bring remainder of infobox content , close button view. i did bit of research , found strategies , workarounds v7 either automatically pan map ensure infobox visible, or re-position infobox opens towards center of map. there plans build behavior v8? if so, can wait bit, if not, need start playing workarounds. there lower priority feature in backlog planned, no timelines when available. note if want infobox work did in bing maps v6.3, there module provides here: http://bingmapsv7modules.codeplex.com/wikipage?title=custom%20infobox%20control it has been tested on bing maps v8 , works. [ blog ] [ twitter ] [ linkedin ] Bing Maps  > 

Website exclusion for content campaigns via the API

i noticed adcenter added website exclusions: http://community.microsoftadvertising.com/blogs/advertiser/archive/2009/05/20/website-exclusion-and-site-performance-reporting-now-available-for-content-ads.aspx what's api call add website exclusions?   i looked @ v7 campaign management api , closest find pausesiteplacements service operation: http://msdn.microsoft.com/en-us/library/dd797162.aspx hello please take @ negativesiteurls element of campaign ( http://msdn.microsoft.com/en-us/library/bb672054.aspx ) , adgroup ( http://msdn.microsoft.com/en-us/library/bb671956.aspx ) objects. note negative site urls specified @ ad group level override negative site urls specified @ campaign level. hope helps. Bing Ads API: Development  >  Bing Ads API: Development

How to replace string between two characters with Regex?

hello! in application have string "sentence 1 rule id: whitespace_rule message: text..." or string "sentence 2 rule id: morfologik_rule message: text..." i want replace this: "rule id: some_rule message", want change first string to "sentence 1: text..." , second string to: "sentence 2: text..." how using regex? hi, try this: string s = "sentence 1 rule id: whitespace_rule message: text..."; s = regex.replace(s, "rule id:[^:]*:", ":"); Visual Studio Languages  ,  .NET Framework  >  Visual C#

REST API in c# to upload document in document Library of sharepoint

in auto hosted app,is possible upload documents sharepoint document library of rest in c#. dont know whether rest can used in c# or not. please let me know. regards, chaitanya c# , rest can go together. example: using (var clientcontext = tokenhelper.getclientcontextwithaccesstoken(sharepointurl.tostring(), apponlyaccesstoken)) { byte[] bytefile = system.io.file.readallbytes(pathtofile); httpwebrequest endpointrequest = (httpwebrequest)httpwebrequest.create(hostweb + "/_api/web/getfolderbyserverrelativeurl('shared%20documents')/files/add(url='filename.txt',overwrite=true)"); endpointrequest.method = "post"; endpointrequest.headers.add("binarystringrequestbody", "true"); endpointrequest.headers.add("authorization", "bearer " + apponlyaccesstoken); endpointrequest.getrequeststream().write(bytefile, 0, bytefile.length); httpwebresponse endpointresponse = (httpwebresponse)end

Enumerating through instances of derived class instances

if have numerous instances of different derived classes (with classes derived same base class), how might possibly enumerate through them, besides them being in list?   to enumerate them, need in collection. if want use instances, "easiest" method typically make array: foreach ( var item in new baseclass[] {instance1, instance2, instance3}) { // use item } if you're making method, can use iterators: ienumerable<baseclass> getenumerator() { yield return instance1; yield return instance2; yield return instance3; } reed copsey, jr. - http://reedcopsey.com if post answers question, please click " mark answer " on post , " mark helpful ". Visual Studio Languages  ,  .NET Framework

WCF - adapter, problem handling response message from external web service

hi! we're experiencing problems handle response message web service call biztalk wcf - basichttp adapter. the error message is: system.servicemodel.protocolexception: there problem xml received network. see inner exception more details. ---> system.xml.xmlexception: encoding in declaration 'iso-8859-1' not match encoding of document 'utf-8'. @ system.xml.encodingstreamwrapper.throwencodingmismatch(string declenc, string docenc) @ system.xml.encodingstreamwrapper.checkutf8declarationencoding(byte[] buffer, int32 offset, int32 count, supportedencoding e, supportedencoding expectedenc) @ system.xml.encodingstreamwrapper.processbuffer(byte[] buffer, int32 offset, int32 count, encoding encoding) @ system.xml.xmlutf8textreader.setinput(byte[] buffer, int32 offset, int32 count, encoding encoding, xmldictionaryreaderquotas quotas, onxmldictionaryreaderclose onclose) @ system.xml.xmldictionaryreader.createtextreader(byte[] buffer, int32 offset, i