Posts

Showing posts from March, 2013

Help me Get Name Of USB Instance Inserted/Removed. Code Below

kindly me improve code posted solution display messages :    "usb serial (com4)" plugged.   "usb serial (com4)" unplugged. using system.management; namespace usbdection {     class program     {         static managementeventwatcher watchingobect = null;         static wqleventquery watcherquery;         static managementscope scope;         static void main(string[] args)         {             scope = new managementscope("root\\cimv2");             scope.options.enableprivileges = true;             addinsetusbhandler();             addremoveusbhandler();             (; ; ) ;         }         public static void addremoveusbhandler()         {             try             {                 usbwatchersetup("__instancedeletionevent");                 watchingobect.eventarrived += new eventarrivedeventhandler(usbremoved);                 watchingobect.start();             }      

Import Oracle DataBase dump file Into Sql Server With out connection oracle using c# code.

hi all, i ask how can imports dump oracle database file data , struct sql server 2005 with out make connection oracle. best regards. hakim.  hi hakim. based on title, understood there issue regarding transfer oracle db dump sql database using c# code. right? if so, afraid there no build-in method meet requrements in .net framework. must provides oradump  export api to allow developers integrate corresponding capabilities  applications. these capabilities export data from  oracle dump files popular databases microsoft sql server. every developer having oradump export api can write few lines of code on c# or  visual basic implement appropriate export process. i search third-party link, but it's a paid service.  http://www.convert-in.com/data-migration-service.htm if don't have code, please refer to: migrating oracle databases sql server 2000 http://technet.microsoft.com/en-us/library/cc966513.aspx best regards, kristin we trying better unde

Retreiving message from MessageBox after occurance of event

hi, the below situation: message type , message type b received biztalk. both transformed , sent downstream application. though both messages received idependently, message b should sent downstream if message has been sent downstream. in case message b received first, should store message persistent storage , wait msg a. once msg arrives , gets sent downstream, should retreieve msg b store , process it. option 1 is have msg b orchestration dehydrate while waiting msg b. can cause supportability issues. option 2 use sql to  store msg b , retreive once msg arrives. looking if possible retreive msg b message box or other out of box capability. any other pattern or design suggestion highly appreciable. thanks. depending on exact requirements solve out-of-the-box biztalk functionality, with option 1. can elaborate on supportability issue? don't need dehydrate orchestration yourself, biztalk you. if you're going option 2 you'll have maintainability issues beca

SendMessage Method :cannot evaluate expression because a native frame is on top of the call stack

hi gurus, i getting message "cannot evaluate expression because native frame on top of call stack"  while executing sendmessage method. method performs operation i.e click final button , complete process , 1 "save as" window pops up,  then here stuck every time. have tried publish code , run same situation coming. i have 2 question after doing hell lot of google... question 1: why control getting stuck every time @ sendmessage? question 2: how can windows handle of save window can close during execution of sendmessage method. code body         [ dllimport ( "user32.dll" , charset = charset .auto, setlasterror = true )]         private static extern intptr sendmessage( intptr hwnd, uint msg, int wparam, int lparam);          public void buttonhandles()         {                           thread .sleep(10000);             try             {                 process [] processes1 = process .getprocesse

Get all IDs from a response using LINQ -

  i trying write query take customer id’s taken response , once have them cancel customers. what did ran search used search request web service , in response list of customer id’s. _request = new searchrequest(); _request.company = "newcompany"; the linq query needs take list of customer id’s response ‘searchrequest’ , find them , delete them. the problem customer id’s can number depending on company name search results. thought write line of code: _response.customers[ ].custid but error because don’t include value can’t because won’t know value. want take many id’s came request , use them in linq query. here have far: ienumerable<customerinfo> custinfo = cust in custinfo cust.custid = _response.customers[].custid //this line wrong            select cust; now give little more detail, once had customer id’s linq query gather them , cancelrequest following code: _request = new cancelrequest(); _request.custid

Specified argument was out of the range of valid values. Parameter name : Policy is not configured in the system

hi, friends. i have problem now, , list details following.   i testing web service. on client side, add web reference in dll, after compiled, generates dll, example, name serviceagent.dll, , add reference to this dll, run program throw out error:   exception in wse - "specified argument out of range of valid values.parameter name: policy (line:19)   but if remove mid-layer serviceagent library project, use external web service directly in client project, works fine. , not know why!  after searched on internet, friends have same problem, think, .net dll can't read configuration file.   my client side code listed below: 1. public quote requestquote( string symbol) 2. { 3. quote q = null ; 4. 5. // request quote external service 6. quoteext qe; 7. stocktradersecureservicewse serviceproxy = new stocktradersecureservicewse(); 8. 9. // permission external web service 10. serviceproxy.credentials = system.net.credentialcac

toolStrip progressBar does not anchor: Has it been fixed?

Image
hi all, i'm trying thing anchor , read won't work. handled form resize event , got work 99% right not perfect. progressbar disapears after i click "restore down" icon. maximize icon after has been clicked. i'm using vs2010 , target x86, .net 3.5 i don't know enough know problem anchor property wondering if it  has been fixed ...in vs2012, .net 4.0 or .net 4.5? thanks hi dsp1024,   welcome msdn forum support.   we're doing research on issue. might take time before you.   sincerely,   jason wang   jason wang [msft] msdn community support | feedback us Visual Studio Languages  ,  .NET Framework  >  Visual C#

How to change registry values using c# (Removing USB Write Protection)

hello experts here , i planning build console app remove write protection on usb ports.. here code wrote remove write protection using registry editor code doesn't work.. can any1 correct code me ... thanks reading... "system.diagnostics.process.start("regedit","[hkey_local_machine\\system\\currentcontrolset\\control\\storagedevicepolicies]writeprotect=dword:00000000"); " something this? microsoft.win32.registry.setvalue("hkey_local_machine\\system\\currentcontrolset\\control\\storagedevicepolicies", "writeprotect", 0, microsoft.win32.registryvaluekind.dword); try, not able test right now... more info at  http://msdn.microsoft.com/en-us/library/3dwk5axy.aspx if (helpful) vote(); Visual Studio Languages  ,  .NET Fra

File content search - open source tools

hi, i know open source tools/api file search. want integrate 1 asp.net/c# windows application. thanks, santhi hi you can try using tika .net libraries (tikaondotnet) along ikvm libraries extracting text content files (word, excel, powerpoint, pdf etc) tika on dot net ikvm tika uses ikvm, need both libraries , both of them open source. once extract file contents simple text, can search within contents using regex or other pattern matching techniques. hope helps. Visual Studio Languages  ,  .NET Framework  >  Visual C#

Create a c# program to validate an instance file

is possible create c# program validate instance of native document against schema? in other words, want duplicate happens when right click schema in biztalk project , select "validate instance". i want using standard c# program.  biztalk provide libraries or api's allow this?   thanks   chris the flat file validation encapsulated in flat file disassembler , not available api. instantiate disassembler , pass message. place start tomas restrepo's pipeline tester: http://winterdom.com/2007/08/pipelinetesting11released   BizTalk Server  >  BizTalk Server General

c# renaming multiple files with text box and check box

Image
ok im trying rename multiple files , move them separate directory   so have done setup  when type map name wanted change files needed , and depending on checked gets moved , renamed been trying 2 days still nothing , cant see why wont  thanks in advance elfenliedtopfan2 can give example of old filename , new filename? jdweng Visual Studio Languages  ,  .NET Framework  >  Visual C#

AOP - Injection Code

hi all, we have application needs log methods executed, writing same code on methods wouldnt nice, thought using aop on it. tried find articles on web frameworks, comparing them etc, hadnt success, cuz articles old or simple. does here uses framework aop? 1 best one? aspect.net, aspect.c#, spring.net + loc, enterprise library? if have article comparing aop frameworks me lot too. regards,   anyone? Architecture  >  Architecture General

how to add image from resource to html code

hello. i'm working on program displays output on webbrowser control. to compose text, create long string concatenating html tags , data need display. sometimes, need add image html output.  this part of html creation, add image: html += "<img src=\"image1.png\" width=\"113\" height=\"113\" border=\"0\">"; the project has existing images in resource folder. how use these resource files image's source pointed resources folder? thanks. hi jaybeev,   welcome msdn forum support.   you need load resource stream. bitmap bmp = new bitmap( system.reflection.assembly.getentryassembly(). getmanifestresourcestream("myproject.resources.myimage.png")); if want know resource names in assembly, go with: string[] = system.reflection.assembly.getentryassembly(). getmanifestresourcenames(); foreach (string 1 in all) { messagebox.show(one); }   besides way solve problem, try using rescou

DataGridView before select change event

hi, have grid , textbox controls binded grid. each time when select new row, able re bind those controls. , if want modify data, can modify text on controls , hit update button, grid updated. question if change new row after modify control without hitting update button. so, grid not updated , data can not saved. case, have popup window give warning. how can make happen, since everyting modify on control, not on entity that compiler  doesn't know has been changed. are  there better solutions ? how have databound grid , textboxes? if done correctly, 2 should in sync , when user types in textbox, shouldn't have click button put textbox data grid, should automatically that. i have old blog post that: http://geek-goddess-bonnie.blogspot.com/2009/09/keeping-datagrids-and-other-ui-controls.html i should update post include using a bindingsource in examples, concept same. if suggestions in blog don't you, post databinding code here please? ~~bonnie berent dewitt [c# mvp

How to decrease RegConnectRegistry timeout?

hi, when connecting remote registry using regconnectregistry() api call, have wait 2 minutes call fail if remote computer not available. how can decrease timeout value e.g. 30 seconds? regards, philipp kerling hi, you may check whether remote computer either pinging system.net.networkinformation.ping ( http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx   ) or enumerating network computers netservenum , checking yout target in list ( see http://pinvoke.net/default.aspx/netapi32/netserverenum.html ). regards, alex pinsker http://alexpinsker.blogpsot.com   Architecture  >  Architecture General

Mobile app backend .net with Table storage

hi! i can't seem table controller work table storage. i've followed approach of sample in server sdk that's in github, when try in swagger, keep getting empty body. i'm not sure put in query options all. i can't find documentation on this. if working, incremental loading work azure sql db ? thanks aline hello aline, i have found below documentation talking using table storage using storagedomainmanager, achieve this. please check below link , let know feedback. http://wp.sjkp.dk/azure-mobile-service-net-backend-using-azure-table-storage/ regards, disclaimer this response contains reference third party world wide web site. microsoft providing information convenience you. microsoft not control these sites , has not tested software or information found on these sites; therefore, microsoft cannot make representations regarding quality, safety, or suitability of software or information found there. there inherent dangers in use of software fou

DocumentDB for eCommerce app

i creating typical ecommerce app list products prices, reviews, etc search, paging , filtering , sorting functionalities. looking scalable , high performance, schemaless , full manged nosql db. documentdb seems interesting me, know doesn't support sort (order by) , function must in such app. sorting in memory using linq or similar approach not visible , not scalable, query result big have in memory each user. is there workaround till sort function added documentdb? any alternative documentdb can use on azure suitable such app? unfortunately no scalable workaround @ present beyond have mentioned or using stored procedure ordering demonstrated in code samples posted on msdn. Microsoft Azure  >  Azure Cosmos DB

Custom Tax calculation in CS2009

hi,   need calculate tax based on products. products have tax , need show total tax amount @ bottom of cart page. in default site defaulttaxcy pipeline component used sets total tax zero( not sure of it). best way calculate tax? whether calculate in code, if calculate in code(i require extend order system guess )or to write pipeline component? guess writing vb script best option. dont know how proceed further. 1 me? thanks. regards, kumudha.d hi kumudha, you need write pipeline component. calculate tax , write tax value tax field. can field information , pipeline property name "orderpipelinemappings" how write pipeline. below links(article max) everything ever wanted know pipelines afraid ask (part i) everything ever wanted know pipelines afraid ask (part ii) custom pipeline : everything ever wanted know pipelines afraid ask (part iii)   after have created pipeline component add basket.pcf. regards rajendra dewani

MPO 3D Photo Files

Image
anyone know of freeware sdk in c# reading mpo & jps 3d photo files. need able read each image , display seperately. i've looked around web , have been unsuccessful in finding anytype of source code or sdk. thanks, keith keith hi keith ,   welcome msdn forum. the .mpo extension stands multiple picture object. a .mpo file 2 jpg files, 1 after another, separated few padding zeros. technically, if "open" 1 of these files in image editing application, see "first" image, because mpo file looks identical regular jpg file @ beginning. the fujifilm .mpo 3d photo format introduction http://dmitrybrant.com/2011/02/08/the-fujifilm-mpo-3d-photo-format   the webbrowser can used display mpo photo such http://dmitrybrant.com/images/dscf0005.mpo        private void form1_load( object sender, eventargs e)         {             webbrowser1.navigate( "http://dmitrybrant.com/images/dscf0005.mpo" );             //webbro

Serial port connection

hello, i have been given assignment connect com3 port c# application in visual studio, question is: have idea how able send line of text com3 port, , put line textbox? the code thought usefull this:   serialport serp = new system.io.ports.serialport("com3", 9600, system.io.ports.parity.none, 8, system.io.ports.stopbits.one); serp.write("test");   as can see, didn’t work out.   so appreciated. you need open port before write it. serialport serp = new system.io.ports.serialport("com3", 9600, system.io.ports.parity.none, 8, system.io.ports.stopbits.one); try { setp.open(); serp.write("test"); serp.close(); } catch { // // not open port ! // exist or open elsewhere ? // } andy Visual Studio Languages  ,  .NET Fra

Starting receive location at particular time

Image
hi,  i have requirement,  like campaign days, after completing campaign need pick data , send destination.so campaign end @ day end  11:59 pm. don't want wait till 11:59 pm. need pick data 11:59 pm , after receiving receive  location need stop(means 1 time ). how can  i achieve this. hi dinesh, you need set service window on recive location. make receive location recieve messages in particular time window.you can make receieve location pick message during dates aslo. refer below screen shot sample refer how configure scheduling receive location for quick walkthrough. as per msdn: can specify dates when want receive location start , stop processing messages. can specify times of day during want receive location process messages. regards mandar dharmadhikari BizTalk Server  > 

Standard output of an FTP process in Windows 8

Image
hi everyone, need help. i developed sw download data ethernet device using ftp protocol. since device doesn't react in right way o.s. api, way found interact using ftp.exe process inside sw, redirecting standard output , analyze output. everything working fine under windows 7, first test windows 8 results in program failure. after investigations, found out standard output changes, depending on operating system installed on pc program running. here follows example of mean. first of all, run ftp.exe command line download file, redirecting standard output file, , response: ftp> connesso 10.1.116.251. open 10.1.116.251 220 cmx tcp/ip - remote ftp server (version 1.0) ready. utente (10.1.116.251:(none)): 331 password required user. 230 user logged in, proceed. ftp> session.tel 200 port command successful. 150 opening ascii mode data connection 'session.tel'. 226 transfer complete. ftp: 1640 bytes received in secondi kbyte/sec) ftp> 0.

Limit LAN usage

Image
hello, i have windows application backup plenty of files (about 50,000 files) over lan. the problem while application works network resources not responding, cannot access server or connect remotely. the application runs on local computer , copying files located on local server. i'am using io.directory.getfiles() discover files , io.file.copy() copy them, sync function runs within system.componentmodel.backgroundworker. is there way limit lan usage of worker or whole appliction? tahnks.. hi igal_b, welcome msdn forum. please take @ similar thread:  http://social.msdn.microsoft.com/forums/en-us/netfxnetcom/thread/c9193d48-8488-49a4-9a5b-ab2f7e0a1812   if currentspeed > allowedspeed thread.sleep(250) 'value increase/decrease better result end if you can try same way. best regards, mike feng msdn community support | feedback us please remember mark replies answers if , unmark them if provide no help.

Doubts regarding web-service service 'SignUpCustomer'.

hi,        myself a programmer, wish use adcenter api  for new web-application.i have doubts about  service ' signupcustomer', listing below .        1) there limit creating customers using ' signupcustomer '.      2) if there limit exists creating customer, please let me know how be.      3) hope customer created using ' signupcustomer ', account , user created along customer. , limit of 10,000 campaigns applied accounts of customers.       suppose have account with  reseller status, if  can create 1 customer, can add 10,000 campaigns account of added customer. if created customer can add   10,000 campaigns using new account newly created customer.       if don't mind please let me know questions right or wrong, if wrong please let me know, possible , not possible during  ' signupcustomer ' operation.   hi sparkdevsupport, i wanted jump in , let know i've got question routed api folks , report answer h

attach file from sql database to mail as attatchment.

hello, i have question. i'm building website can upload file ( word, excel..) to sql database. working fine. have able send documents sql database mail address attachment. below send page code not working me i'm doing wrong. public void button1_click(object sender, eventargs e)     {         int id = int.parse(request.querystring["id"].tostring());         byte[] bytes;         string filename, contenttype;         string mailfrom = convert.tostring( xxxxxxxxxxxxxxxxx@gmail.com );   //your own correct gmail address         string password = convert.tostring("xxxxxxxxxxxxxxxxx");         string mailto = convert.tostring(txtemail.text);    //email address whom want send mail         string constr = configurationmanager.connectionstrings["msdb"].connectionstring;         using (sqlconnection con = new sqlconnection(constr))         {             sqlcommand cmdselect = new sqlcommand("select name, data, contenttype

SSRS Soap Interface - Getting Images using RenderStream to display

i have php code calls render2 method render ssrs report.  i'll pass streamid renderstream method images report (in example below, there's 1 image on report - company logo).  the image gets written images directory file.  img tag in resulting html looks fine ( < img src = "images/11d3f3fc-0e57-4373-b43e-02adc3a86c52" /> ).  however, images not display when resulting html displayed.  if add file extension (.jpg) file , resulting html (just using static copy of resulting html), image displays fine.  when try encoding or mimetype elements renderstreamresponse, aren't there - result element.  what can add either extension added img tag , mimetype returned, or extensionless img tag display properly? $deviceinfo = "<deviceinfo><toolbar>false</toolbar><streamroot>images/</streamroot></deviceinfo>"; $parameters = array ( "format" => "html4.0", "deviceinfo&