Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OleDbHelper
Message
De
29/11/2004 13:53:32
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
OleDbHelper
Divers
Thread ID:
00965480
Message ID:
00965480
Vues:
38
I was to reuse an existing function method (see below)
that uses it but when I try to compile the code, it was
giving an error message. It says: The type or namespace
name 'OleDbHelper' could not be found (are you missing a
using directive or an
assembly reference?) But I already reference it by
declaring with 'using System.Data.OleDb" at the top. Any
idea?
*** CODE SAMPLE ***
public string GetCAREDataOleDb(string _NodeName) 
		{
			try 
			{
				XmlDocument _doc = new XmlDocument();
				string _returnValue = "";
				XmlNode _parentNode;
				XmlNode _childNode;
				OleDbDataReader _reader = null;

				string _delimStr = " ,";
				string _tmpVar = "";
				char [] _delimiter = _delimStr.ToCharArray();
				string _CAREQuery = "SELECT AC.CAF_NBR,AC.PAT_ID,AC.DATE_OF_APPLICATION,AC.DATE_OF_ASSESSMENT,AC.DATE_OF_ADMISSION,AC.PROGRAM_NBR, AC LEFT OUTER JOIN REGISTRATION R ON AC.CAF_NBR = R.CAF_NBR LEFT OUTER JOIN CARE_GIVER CG ON AC.PAT_ID = CG.PAT_ID LEFT OUTER JOIN
PATIENT P ON AC.PAT_ID = P.PAT_ID Where AC.CAF_NBR = " + this.CAFNumber.ToString() + " And  (AC.CCAC = '1' OR AC.CCAC = '4')";

				string[] _tmpArray;
 
				_reader = OleDbHelper.ExecuteReader(MyAppCommon.CAREDBConn, System.Data.CommandType.Text, _CAREQuery);

				//get column names
				_tmpArray = _CAREQuery.Split(_delimiter);
				if (_reader != null) 
				{
					if (_reader.HasRows) 
					{
						_reader.Read();
						_parentNode = _doc.CreateNode(XmlNodeType.Element,_NodeName,"");
						for (int _index=0; _index < _reader.FieldCount; _index++) 
						{
							// +1 because the first in the list is the "SELECT" word
							_tmpVar = _tmpArray[_index+1];
							_childNode = _doc.CreateNode(XmlNodeType.Element,_tmpVar.Substring(_tmpVar.LastIndexOf(".")+1),"");
							_childNode.InnerText = _reader[_index].ToString();
							_parentNode.InsertAfter(_childNode,_parentNode.LastChild);
						}
						_returnValue = _parentNode.OuterXml;
					} 
					else
					{
						_returnValue = "";
					}
				}
				return _returnValue;

*** END CODE ***
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform