Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

JoZ CaVaLLo

@JoZ CaVaLLo
About
Posts
47
Topics
28
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • XmlSerializer fail loading myproj.XmlSerializers.dll
    J JoZ CaVaLLo

    I found the solution on my own: In the addon binding I have to add the following event: AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += new ResolveEventHandler(currentDomain_AssemblyResolve); In that event I can specify the path of the dll I wish to use.

    Life is not short... the problem is only how you organize yourself

    C# help csharp xml question

  • XmlSerializer fail loading myproj.XmlSerializers.dll
    J JoZ CaVaLLo

    Hi all... and Happy new year! I already posted but got and found no solutions, I'll try to explain in a easier way: When I launch my XmlWriter.Serialize(MyType), it doesn't work. Usually when .NET uses the dll MyType.XmlSerializers.dll, which is compiled together with MyType.dll. At run time, if .NET does not find MyType.XmlSerializers.dll it creates at execution time. Now my problem is that it seams like .NET is using a completely different xmlserializer. And it always throws a System.InvalidOperationException, There was an error generating the XML document. String cannot have zero length at System.Reflection.Assembly.nLoad() Does somebody have a tip? P.S.: My app is an addon, so probably .NET is invoking an xmlserializer of the main app. When I run the addon by itself everything works.

    Life is not short... the problem is only how you organize yourself

    C# help csharp xml question

  • XmlSerializer not always working
    J JoZ CaVaLLo

    Happy new year to everybody! I did some researches and what I understand is that my app does not generates correctly the "MyProject.XmlSerializers.dll" ... Or else it uses another xmlserializer instead of this one. As said above my app is an Addon and is called from an outside application. This may confuse .NET and I found out that using the GAC may resolve the problem.... But I don't wanna do that. Any other suggestion would be appreciate!!!

    Life is not short... the problem is only how you organize yourself

    C# help question data-structures tools xml

  • XmlSerializer not always working
    J JoZ CaVaLLo

    Hi people!!! I had to develop an application that has to work as standalone and also as "add on" of some ERP systems. One of the things done in my program is to have an object serialized to an XML File. It works 90% of the time... but under ONE of the ERP Systems (SAP) I get a System.InvalidOperationException: "There was an error generating the XML document", InnerException is "Could not load file or assembly 'Swissdec..." What is driven me crazy is that this exception is generated inside that assembly... Does somebody have an idea??? here is the stack: Title: System.InvalidOperationException Date/Time: 19.12.2008 08:53:43 Message: There was an error generating the XML document. StackTrace: at SCS.Swissdec.XmlGenerator.GenerateXmlFileAsDeclareSalary(String pPathToGenerate) at SCS.Swissdec.SwissdecLogic.Send(DateTime pFromDate, DateTime pToDate, String pSubstituteRequestId) at SCS.SalaryGUI.Tools.SwissdecControl.btnSend_Click(Object sender, EventArgs e) ****************************** Message: Could not load file or assembly 'Swissdec, Version=10.10.108.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) StackTrace: at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterDeclareSalary.Write81_DeclareSalary(Object o) ****************************** Message: String cannot have zero length. StackTrace: at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at SCS.Salary_B1AddOn.currentDomain_AssemblyResolve(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(String assemblyFullName) ******************************

    Life is not short... the problem is only how you organize yourself

    C# help question data-structures tools xml

  • Bulk Copy with Images
    J JoZ CaVaLLo

    It's not this the problem... I have a windows application, where I put and receive images in pictureboxes from an sql server (wich naturally can be located on another pc). Now I have the need that this server take the pictures from the table and put them in his c:\temp ... and this with bcp does not work...

    Life is not short... the problem is only how you organize yourself

    Database question database sql-server sysadmin help

  • Bulk Copy with Images
    J JoZ CaVaLLo

    Found my own response: USE[DataBase] GRANT CONNECT TO [guest] GRANT SELECT TO [guest]

    Life is not short... the problem is only how you organize yourself

    Database question database sql-server sysadmin help

  • Bulk Copy with Images
    J JoZ CaVaLLo

    Hi... Tank you for your answers... I tried another solution: with bcp I temporarily store a vbscript file where I have the code to connect to the database, select the image and store it in the file I want. I then call it using the following command EXEC xp_cmdshell 'cscript "C:\temp\StoreImage.vbs"' It works very well with SQL Server 2005 in any configuration. But when I try with a SQL Server 2005 Express Edition, when I use trusted connection, the script fails getting an "Access denied" error. Should I change something in the rights of the sqlserver account? but what?

    Life is not short... the problem is only how you organize yourself

    Database question database sql-server sysadmin help

  • Bulk Copy with Images
    J JoZ CaVaLLo

    I don't wanna store images in database... that's already done and it's easy stuff! What I wanna do is to have the database exporting a picture from a table to a folder of the server (i.e c:\temp\myimage.jpg) I've googled around and found this textcopy... but as said in the previous post, it's not distributed by sql server 2005

    Life is not short... the problem is only how you organize yourself

    Database question database sql-server sysadmin help

  • Bulk Copy with Images
    J JoZ CaVaLLo

    Hi... tanks a lot for your answer... The only problem is that Textcopy is not supported in sql server 2005 http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=708866&SiteID=1[^] It was a sql 2000 utility... and I cannot go to all my clients telling that they have to copy Textcopy.exe on their server #@|°@#@¬@#°§@ Microsoft :-S

    Life is not short... the problem is only how you organize yourself

    Database question database sql-server sysadmin help

  • Bulk Copy with Images
    J JoZ CaVaLLo

    Hi... I have a table with a column containing images. I'd like that my sql server 2005 stores those images on his backup device. I tried with the following command EXEC xp_cmdshell 'bcp "SELECT Image FROM table WHERE ID=1" queryout "C:\Temp\myImage.jpg" -c -T' I get a file that seems a jpg image... but it's not... I think it's because bcp queryout works only with text data. Does somebody have any idea on how can I get this working?

    Life is not short... the problem is only how you organize yourself

    Database question database sql-server sysadmin help

  • Enable Apply button when needed
    J JoZ CaVaLLo

    Hi... I need to enable my Apply button only when the user edits something on the form (I have datagrids, text-, check-, comboboxes). All of them are bounded to a Databinding. What's the best way to get this behaviour?

    Life is not short... the problem is only how you organize yourself

    C# help question

  • Is DBF table ANSI?
    J JoZ CaVaLLo

    Normally not... but the problem is that all language specific char may not be read correctly. For exemple instead of ü i get | ... to solve that problem I have to decode the table (this is already done) The problem is that some times I get tables that are already encoded correctly... in that case I don't need to decode the table...

    Life is not short... the problem is only how you organize yourself

    C# csharp database help question

  • Is DBF table ANSI?
    J JoZ CaVaLLo

    Hi, when I open a dbf table with dBALite I can see under Database Info whether a table is ANSI or not... Is there a way to get the same information when I open that table in a C# program?

    Life is not short... the problem is only how you organize yourself

    C# csharp database help question

  • add data in datarow and fit max length columns
    J JoZ CaVaLLo

    I found my own answer... I have to use the ColumnChanging event on the table and use the following code:

    void ColumnChanging(object sender, DataColumnChangeEventArgs e)
    {
    if (e.Column.DataType == typeof(string))
    {
    if (e.ProposedValue.ToString().Length > e.Column.MaxLength)
    e.ProposedValue = e.ProposedValue.ToString().Substring(0, e.Column.MaxLength - 1);
    }
    }

    Life is not short... the problem is only how you organize yourself

    C# help question

  • add data in datarow and fit max length columns
    J JoZ CaVaLLo

    Hi body... I have the following problem: I fill a datarow with some data coming from another program, when I try to do DataTable.AddMyRow(Myrow), I get the following exception: Cannot set column 'BeneficiaryName'. The value violates the MaxLength limit of this column. Is there a way to set the DataTable in order to "auto truncate" the exceeding length? Thank you

    Life is not short... the problem is only how you organize yourself

    C# help question

  • xml serialisation
    J JoZ CaVaLLo

    the right use of XmlSerializerNamespaces is

    XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
    namespaces.Add("ct", "http://www.swissdec.ch/schema/sd/20051002/SalaryDeclarationContainer");
    namespaces.Add("sd", "http://www.swissdec.ch/schema/sd/20051002/SalaryDeclaration");
    namespaces.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance");

    System.IO.File.Delete(pPathToGenerate);
    fs = new System.IO.FileStream(pPathToGenerate, System.IO.FileMode.Create);
    writer = new System.Xml.Serialization.XmlSerializer(typeof(XmlSerializatorItems.DeclareSalary));
    writer.Serialize(fs, oDeclare, namespaces);
    fs.Close();

    In the object to serialize you have to specify the namespace for each field.

    Life is not short... the problem is only how you organize yourself

    C# xml database help tutorial question

  • decimal format in xml serialization
    J JoZ CaVaLLo

    Hi I have an object I need to serialize in XML. In my object I have some decimal fields that in the XML file must (MUST) appear with 2 decimals. Is there a way to tell the serializer he must format all decimal that way?

    Life is not short... the problem is only how you organize yourself

    C# xml json help question

  • xml serialisation
    J JoZ CaVaLLo

    Hi... I need to create an XML file from an object, and I have to obtain the the following root element:

    <declaresalary>
    xmlns:st="http://www.swissdec.ch/schema/sd/20051002/SalaryDeclarationServiceTypes"
    xmlns:ct="http://www.swissdec.ch/schema/sd/20051002/SalaryDeclarationContainer"
    xmlns:sd="http://www.swissdec.ch/schema/sd/20051002/SalaryDeclaration"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    ct:requestcontext
    ...

    My problem is that I can't figure out how to set all those xmlns attributes. Can somebody give me an hint please?

    Life is not short... the problem is only how you organize yourself

    C# xml database help tutorial question

  • dll... load another version...
    J JoZ CaVaLLo

    It's a little bit difficult: it's SAP :-S ... SAP has an addon wich work in the directory \root ... under root you can find all the dlls used by this addon... I'm programming an addon of the addon (called 1staddon) :-D ... and by default all my dlls should reside in \root ... To avoid others addon to overwrite our dlls with the same name, we decided to put our dlls in \root\mydir ... The problem is that 1staddon loads \root\a.dll and than calls my addon ... but my addon needs to use \root\mydir\a.dll, which is not loaded coz there is already \root\a.dll.

    Life is not short... the problem is only how you organize yourself

    C# question csharp help announcement

  • dll... load another version...
    J JoZ CaVaLLo

    Hi! I have a C# program running with a 3rd party dll version 3.5... When I run it on another machine, having another program with same dll, but version 3.8, I have lots of troubles when the other application has started before then mine. How can I force my application to load the dll version 3.5? Thanks a lot

    Life is not short... the problem is only how you organize yourself

    C# question csharp help announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups