I am trying to write a few C # console applications which will run a query on the existing ODBC connection and will change the ResultSet Any XML file please put some light on this?
I was thinking of using System.Xml.XmlReader to work this context in the following context,
System.Data. Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection (); Conn.ConnectionString = "FIL = MS Access; DSN = Name of Valid Data Source"; String query = "XML auto, select from customers for elements"; Try {OdbcCommand odbcComm = New OdbcCommand (query); Conn.Open (); OdbcComm.Connection = conn; OdbcDataReader data = odbcComm.ExecuteReader (); . . . } Hold (Exception Pre) {System.Console.WriteLine ("Failed to connect to Data Source"); } Finally {conn.Close (); } What do you think?
This is what I have used a webservice I copied from work right because of the crap here I will not enter the web service code but this code should make you basically a method and the node portion should return the result / result with that method and since then use the xmlnodeReader, and whatever field is required from it, its dataable And replace with your own with the field Field Name Value XmlNode node = svc.GetInfoByZIP ("02116"); Dataset ds = new dataset (); (Using XmlNodeReader Reader = New XmlNodeReader (node)) {ds.ReadXml (Reader); } DataTable Table = DTTables ["Table"]; Detroit Row = Table Fury [0]; String City = (string) line ["CITY"]; String state = (string) line ["state"]; String zip = (string) line ["zip"]; }
Comments
Post a Comment