
LostProgrammer
Avatar/Signature-
Posts
125 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by LostProgrammer
-
Load XML file and extract elements in C#
LostProgrammer replied to session101's topic in Database / XML / Reporting
load not loadxml loadxml uses a string of xml to load the document. what you want is a stream. use xmldocument.load(stream) - create a filestream using the path and then call load. -
just an idea have you looking into wmi? try managementEven****cher, managementObjectSearcher, and win32_printjob. i think if you're going to find anything, this would be the place to start. good luck, -lp
-
you could use a javascript function and then when the link is clicked call RegisterStartupScript or add onclick attribute to link when it is databound in the grid. i'm sure there are other ways but this is how i've done it. Page.RegisterStartupScript("ScrollToPosition", String.Format("<script language='javascript'>ScrollToElem('{0}')</script>", String)); <script type="text/javascript" language="javascript"> function ScrollToElem(elemId) { var elem = document.getElementById(elemId); if (elem == null) { return; } elem.scrollIntoView(true); } </script> -lp
-
Calling a remote object from web GUI acting as client problem
LostProgrammer replied to bri189a's topic in ASP.NET
can you post your <system.runtime.remoting> section from web.config? also post remoting config for host service. i struggled with exact same scenario for awhile but finally got it so maybe i can help. -lp -
import clr namespace into schema
LostProgrammer replied to LostProgrammer's topic in Database / XML / Reporting
Generate XSD for CLR Type write xsd using xsd.exe - works for any type that implements IXMLSerializable xsd System.Data.dll /t:DataSet nothing like trying to make things more complicated that they need to be. -lp -
I want to reference a CLR type in an xsd file. Is there someway to reference the schema that would contain the the type? Is it available @ schemas.microsoft.com? something like: <xs:schema id="Schema1" xmlns:data="http://tempuri.org/Data.xsd"/> <xs:import schemaLocation="Data.xsd" namespace="http://schemas.microsoft.com/clr/nsassem/System.Data" /> <xs:element name="Command" type="data:SqlCommand"/> any thoughts, ideas, leads appreciated. Thanks -lp
-
1 - Genderate key file using sn -k 2 - Compile .cs file with keyfile option from command prompt csc /t:library myassembly.cs /keyfile: mykeyfile.snk 3 - add dll to gac gacutil /i myassembly.dll 4 - run regasm regasm myassembly.dll /tlb:myassembly.tlb -lp
-
same problem, different issue so here's what i left with xs:ObjectTree/xs:DataDictionary/xs:Tables/xs:Table[attribute::Name=parent::node()/xs:Table/@Name]/xs:Propertys/xs:Property" the expression is evaluating correctly, however not like i initially thought. it seems that the reference to parent::node() is the parent of the current Table node, not the parent of the the original context. I can only assume that the xs:ObjectTree/xs:DataDictionary/xs:Tables/xs:Table changes the context of the expression. So the question becomes, how do i reference the original context node after some traversal of the tree(objecttree/datadictionary/tables/table)?
-
...predicate evaluation if n is the current node: This returns a nodelist with the correct nodes n.SelectNodes("/xs:ObjectTree/xs:DataDictionary/xs:Tables/xs:Table[attribute::Name='Customers']/xs:Propertys/xs:Property", nsmgr) ...And this prints 'Customers' Dim child As XmlNode child = n.SelectSingleNode("parent::node()/xs:Table", nsmgr) MsgBox(child .Attributes("Name").Value) when i replace 'Customers' with "parent::node()/xs:Table/@Name" giving n.SelectNodes("/xs:ObjectTree/xs:DataDictionary/xs:Tables/xs:Table[attribute::Name=parent::node()/xs:Table/@Name]/xs:Propertys/xs:Property", nsmgr) I get a list of all Property Nodes from all Table/Propertys not a filtered list. Shouldn't 'parent::node()/xs:Table/@Name' evaluate to 'Customers' in the expression? thanks, lp
-
I want to select a node set base on the attribute value of a sibling node. I have a nodes <Table Name='Customers> <Field Name='CustomerId'/> <Field Name='AccountNumber'/> </Table> <ExtendedDataType> <Table Name='Customers'/> <Field Name='CustomerId'/> </ExtendedDataType> This query returns all of the Property nodes from the Customers table: /xs:Tables/xs:Table[attribute::Name=Customers]/xs:Propertys/xs:Property I want to replace 'Customers' with parent::Table[attribute::Name] resulting in something like /xs:Tables/xs:Table[attribute::Name=parent::Table[attribute::Name]/xs:Propertys/xs:Property so that I can filter the choices for Field of ExtendedDataType by using the Table Name that has already been selected. can this be done? do i need a variable or something? Thanks for the help, lp
-
solution I found this on groups.google "createElement always adds an empty namespace-attribute. The solution i found is: Use the createnode-method and set the namespace of the element to the namespace e.g. of the root-element. " try this: XMLDocument.CreateNode(XmlNodeType.Element, "", elem.QualifiedName.Name, XMLDocument.DocumentElement.NamespaceURI) it worked for me. -lp
-
Does anyone know of an easy way to create a new xmlnode based on a schema element. if elem is a XMLSchemaElement then Dim xmlnode as New XMLNode = elem.CreateInstance thanks, lp
-
Given an XMLNode from an instance document that uses a schema, how do I get the corresponding schema element? I've found posts about XMLNode.definition or XMLNode.GetNamespaces but these properties/methods do not appear to exist in 1.1. I also found the SchemaInfo property in 2.0, which is exactly what i want but again it's not implemented in 1.1 Is there a quick, easy way to obtain this info? Thanks , -lp
-
xml schema extended data types
LostProgrammer replied to LostProgrammer's topic in Database / XML / Reporting
well, i know the explanation isn't much good but here's a great link to the kinds of things i was talking about http://www.xfront.com/VariableContentContainers.html specifically Method 3: Implementing variable content containers using an abstract type and type substitution -
i need to define custom DataTypes with an xml schema. Each DataType will have a name element and needs to extend from a base type. How do you define an element that extends from any one of the primitive types? example instance document: <DataType><Name>Integer<\Name><Extends>xs:integer<\Extends> <DataType><Name>String<\Name><Extends>xs:string<\Extends> ?schema: <xs:complexType name="DataType"> <xs:sequence> 'Define Name Element <xs:element name="Name" type="xs:string"></xs:element> 'Define Extends Element <xs:element name="Extends" type="ExtendedType"></xs:element> or something like ...... <xs:extension base="any of the base types (integer, string, date, ...) </xs:sequence> </xs:complexType> <xs:complexType name="ExtendedType"> <xs:choice> <xs:extension base="xs:string"></xs:extension> <xs:extension base="xs:integer"></xs:extension> <xs:extension base="xs:date"></xs:extension> </xs:choice> </xs:complexType> any ideas welcome and appreciated, thanks, -lp
-
post some code.
-
neither, pass tcpTemp to an object and create the networkstream from the tcp client. example, i wrote a small text based poker program and created a new player each time a player connected through acceptTCPClient and passed the client to the constructor of the player, used client.GetStream and communicated through binarywriter(stream) and binaryreader(stream) New Player(c as tcpClient) client = c Dim stream As NetworkStream = client.GetStream Dim w As BinaryWriter = New BinaryWriter(stream) Dim r As BinaryReader = New BinaryReader(stream)
-
use directory services to query active directory.
-
You don't need remoting to run a program on a different machine. Look into servicecontrollers where you can specify the machine name and the service to run. Or look at the process class which allows you to do the basically the same thing. -lp
-
Assumptions: 1) Single Call remote objects are ideal because they are stateless and will be destroyed after each method call 2) Activator.GetObject does not return the newly created object, only a proxy to the object If anyone can dispute these with documented proof please do, because there seems to be ambiguous info on remoting in .net. So, if the above are true , then ideally, wouldn't you call activator.getobject to create a new instance of the remote object each time you needed to call a method of that object? None of the examples or docs that i have seen state this directly. Is this true? Activator does not generate a a network call so there is no need to pass the r.o between forms or hold a reference in a class member. Thanks for any comment, -lp
-
Roey, Glad to hear i'm not the only one. Worst yet, nobody seems to respond to my post after months of waiting. Ingo's book is a lot to take on. My favorite vb.net book so far is the Programmer's Cookbook. It has examples of everything, services, system tray icons, remoting, message queueing, threading, asp.net, webservices ... Anyway, i have been able to get a few remoting examples to work, so if you have any specific questions, I can try to help. -lp
-
Do have any kind of access to the other domain? How are you authenticating? How can you see an internal ip from outside the domain? Is the ip static? Application Domains or Network Domains??
-
Does anyone have any experience with Remote Objects in vb.net? Please respond if you do. Anyway, I have a r.o. that contains a db component. The db layer handles inserting/updating/deleting info in the database. If an error is thrown in the db layer and the transaction is rolled back, what should happen to the exception. Should it propagate back to the client or be handled server side? Should the client be notified that the transaction was not commited? On server side, i could log it, email it, send to a message queue, but without the client monitoring a message queue they would never know the true reason the item was not commited to the database. Of course, I could return Nothing from the remote object call, or a small message object but what is the 'best practice' in this situation? Thanks for you help, -lp