Posts

Using transactions

hi, i using c#.net 2005, sql server 2000. i have few questions ask. firstly, can me telling difference between code below , same code comments removed:             string localquery = "select bla bla";             sqldataadapter _sda;             datatable _dt;             sqlcommand _cmd;             bool iserrcatched = false;             exception exctothrow = new exception();             using (sqlconnection _cn = newconnection) // newconnection returns static sqlconnection object             {                 _cn.open();                 _cmd = new sqlcommand(localquery, _cn);                 //sqltransaction mytrans;                 //mytrans = _cn.begintransaction();                 //_cmd.transaction = mytrans;                 _dt = new datatable();                 _sda = new sqldataadapter(_cmd);                 try                 {                     _sda.fill(_dt);                     _sda.dispose();                     //mytrans.commit();                 }        ...

Issues accessing DTS packages on SQL Server 2000 from SQL Server 2008R2

 i have sql server 2014 , sql server 2008r2 installed , trying access dts packages on sql server 2000 sql server 2008r2. on window 7, 64 bit machine. after sql server 2008r2 installed, installed, microsoft sql server 2005 backward compatibility components- sqlserver2005_bc_x64.msi and microsoft sql server 2000 dts designer components sqlserver2005_dts.msi then manually copied files from- c:\program files (x86)\microsoft sql server\80\tools\binn copy semsfc.dll sqlgui.dll sqlsvc.dll to c:\program files (x86)\microsoft sql server\100\tools\binn\vsshell\common7\ide c:\program files (x86)\microsoft visual studio 9.0\common7\ide then navigate c:\program files (x86)\microsoft sql server\80\tools\binn\resources\1033 copy semsfc.rll sqlgui.rll  sqlsvc.rll to c:\program files (x86)\microsoft sql server\100\tools\binn\vsshell\common7\ide\resources\1033 but didn't help. can see dts packages, when right click , open error i error- sql...

opening xls, error in InvokeMember("Open", .. )

  hi everyone, i need open xsl document, edit , save new file. i've error on line in bold (so can't open document)    //here create workbooks , worksheet type exceltype = type.gettypefromprogid("excel.application"); objexlapp = activator.createinstance(exceltype); exceltype.invokemember("visible", system.reflection.bindingflags.setproperty, null, objexlapp, new object[] { false }); exceltype.invokemember("usercontrol", system.reflection.bindingflags.setproperty, null, objexlapp, new object[] { true }); objbooks = objexlapp.gettype().invokemember("workbooks", bindingflags.getproperty, null, objexlapp, null); objbook = objbooks.gettype().invokemember("add", bindingflags.invokemethod, null, objbooks, null); objsheets = objbook.gettype().invokemember("worksheets", bindingflags.getproperty, null, objbook, null);   parameters = new object[1]; parameters[0] = 1; object objsheet...

Azure SQL - xQuery support

does the xquery implementation in azure sql support upper-case()/lower-case() functions in ss 2008?  i require case-insensitive query of xml data. hi scottyrs, yes, supported. please execute following sample in sql azure database: declare @x xml = n 'abcdef' select @x.value( 'fn:upper-case(/text()[1])' , 'nvarchar(10)' ),@x.value( 'fn:lower-case(/text()[1])' , 'nvarchar(10)' ) result: ---------- ---------- abcdef     abcdef (1 row(s) affected) please remember mark replies answers if , unmark them if provide no help. get or request code sample microsoft if have feedback, please tell us. Microsoft Azure  >  Azure SQL Database

Any problems deploying to Windows 2008 R2?

when install november ctp on windows 2008 r2 box (uac=off), , try reference microsoft.complexeventprocessing.eventtypeattribute get:     type or namespace name 'eventtypefield' not found (are missing using directive or assembly reference?)  i don't have problem when test same code on windows 7 box.  have pointers of things must not have installed? thanks robert robert robert, i believe eventtypefield attribute dropped release of november ctp (along attendant requirement decorate event types such); should able remove [eventtypefield] attributes code , rebuild project without issues.  the reason can figure you're not running issues on windows 7 box there's older (possibly august ctp) lying around that's being picked accident. regards, mark SQL Server  >  Microsoft StreamInsi...

SMO System.Security.SecurityException

hello everybody i wrote backup procedure using smo. procedure works great on dev box, once deployed hosting company's web server throws above exception ("system.security.securityexception: assembly not allow partially trusted callers.") i did research on subject , seems hosting companies give medium trust in config file , hence cannot access smo. my hosting admin great fellow (www.alsonetworks.com, recommended!) , willing out, told me he: a. installed smo 2008 in gac b. added them medium.config file even so, still receive error. now, i'm pretty sure he'd possible work (sans giving full trust) i'd got tell him do. so can advise additional steps can done work? my site built vb asp.net 3.5 against mssql 2008, hosting site uses mssql 2005. i appreciate , advice ps. i've read lot allowpartiallytrustedcallers, understand irrelevant here have not written assembly. ms could/should do. correct?   heres code : public shared sub backup() di...

How to compare schemas and update data

is there way can compare 2 schema's , apply changes in xml data. for example:    i have table untyped xml column ·          table dbo.contacts(                        contact_id                 int                     not null         primary key,             schema_name          varchar(100)        null,             attributes_xml            xml                    null    ) i have multiple schemas in sys.xml_schema_collections. one of them contactsschema <xs:schema id="contactsschema"     targetnamespace="http://tempuri.org/contactsschema.xsd"     elementformdefault="qualified"     xmlns="http://tempuri.org/contactsschema.xsd"     xmlns:mstns="http://tempuri.org/contactsschema.xsd"     xmlns:xs="http://www.w3.org/2001/xmlschema">   <xs:complextype name="contact">     <xs:sequence>       <xs:element name="fname" type="xs:string" />...