本文整理汇总了C#中IDnaDataReader.NextResult方法的典型用法代码示例。如果您正苦于以下问题:C# IDnaDataReader.NextResult方法的具体用法?C# IDnaDataReader.NextResult怎么用?C# IDnaDataReader.NextResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDnaDataReader
的用法示例。
在下文中一共展示了IDnaDataReader.NextResult方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateArticleSearchXml
//.........这里部分代码省略.........
//set the previous h2g2id to this one
previousH2G2ID = h2g2ID;
//Create fill an new Phrase object
Phrase nameSpacedPhrase = new Phrase();
String nameSpace = String.Empty;
String phraseName = dataReader.GetStringNullAsEmpty("phrase");
if (phraseName != String.Empty)
{
if (dataReader.Exists("namespace"))
{
nameSpace = dataReader.GetStringNullAsEmpty("namespace");
}
nameSpacedPhrase.NameSpace = nameSpace;
nameSpacedPhrase.PhraseName = phraseName;
//add it to the list
phraselist.Add(nameSpacedPhrase);
//Record Popular Phrases.
if (popularPhrases != null)
{
popularPhrases.AddPhrase(phraseName, nameSpace);
}
}
} while (dataReader.Read());
}
articleKeyPhrases.Add(h2g2ID, phraselist);
dataReader.NextResult();
if (dataReader.Read())
{
total = dataReader.GetInt32NullAsZero("TOTAL");
//The stored procedure returns one row for each article. The article's keyphrases have been stored in articleKeyPhrases.
XmlNode article = CreateElementNode("ARTICLE");
do
{
count++;
h2g2ID = dataReader.GetInt32NullAsZero("H2G2ID");
//Start filling new article xml
AddAttribute(article, "H2G2ID", h2g2ID);
int editorID = dataReader.GetInt32NullAsZero("editor");
XmlNode editor = CreateElementNode("EDITOR");
User user = new User(InputContext);
user.AddUserXMLBlock(dataReader, editorID, editor);
article.AppendChild(editor);
AddTextTag(article, "STATUS", dataReader.GetInt32NullAsZero("status"));
AddXmlTextTag(article, "SUBJECT", dataReader.GetStringNullAsEmpty("SUBJECT"));
AddTextTag(article, "TYPE", dataReader.GetInt32NullAsZero("type"));
AddDateXml(dataReader, article, "DateCreated", "DATECREATED");
AddDateXml(dataReader, article, "LastUpdated", "LASTUPDATED");
//Add Extra Info XML where it exists.
string extraInfo = dataReader.GetAmpersandEscapedStringNullAsEmpty("EXTRAINFO");
if (extraInfo != string.Empty)
{
示例2: ReadTemplateData
/// <summary>
/// Method that reads the datareader and extracts the template and field info
/// </summary>
/// <param name="dataReader"></param>
private void ReadTemplateData(IDnaDataReader dataReader)
{
if (dataReader.HasRows)
{
//Clear existing field data List ready for new set
_uiFieldData.Clear();
if (dataReader.Read())
{
_name = dataReader.GetStringNullAsEmpty("TemplateName");
_UITemplateID = dataReader.GetInt32NullAsZero("UITemplateID");
_builderGUID = dataReader.GetGuid("BuilderGUID");
if (dataReader.NextResult())
{
while (dataReader.Read())
{
UIField uiField = new UIField(InputContext);
uiField.LoadFieldFromDatabase(dataReader);
_uiFieldData.Add(uiField.Name, uiField);
}
}
}
}
else
{
AddErrorXml("ReadTemplateData", "No template data returned, invalid UI Template ID.", null);
_hasErrors = true;
}
}
示例3: CreateRouteXML
/// <summary>
/// CreateRouteXML from a dataReader.
/// Allows standard Route XML to be generated from different resultsets.
/// </summary>
/// <param name="dataReader"></param>
/// <param name="includeLocations">Whether the locations need to be included or just route info</param>
public void CreateRouteXML(IDnaDataReader dataReader, bool includeLocations)
{
int count = 0;
XmlElement routeXML = (XmlElement) AddElementTag(RootElement, "ROUTE");
if (dataReader.HasRows && dataReader.DoesFieldExist("RouteID"))
{
AddAttribute(routeXML, "ROUTEID", dataReader.GetInt32NullAsZero("RouteID").ToString());
AddTextTag(routeXML, "ROUTETITLE", dataReader.GetStringNullAsEmpty("RouteTitle"));
AddTextTag(routeXML, "ROUTEDESCRIPTION", dataReader.GetStringNullAsEmpty("RouteDescription"));
AddTextTag(routeXML, "DESCRIBINGARTICLEID", dataReader.GetInt32NullAsZero("H2G2ID").ToString());
AddTextTag(routeXML, "SUBJECT", dataReader.GetStringNullAsEmpty("Subject"));
//AddTextTag(routeXML, "GPSTRACKDATALOCATION", dataReader.GetStringNullAsEmpty("GPSTRACKDATALOCATION"));
if (includeLocations)
{
XmlElement locations = AddElementTag(routeXML, "LOCATIONS");
if (dataReader.NextResult() && dataReader.Read())
{
do
{
count++;
XmlElement location = AddElementTag(locations, "LOCATION");
location.SetAttribute("LOCATIONID", dataReader.GetInt32NullAsZero("LocationID").ToString());
location.SetAttribute("ORDER", dataReader.GetInt32NullAsZero("Order").ToString());
AddTextTag(location, "LATITUDE", dataReader.GetDoubleNullAsZero("Latitude").ToString());
AddTextTag(location, "LONGITUDE", dataReader.GetDoubleNullAsZero("Longitude").ToString());
AddTextTag(location, "LOCATIONTITLE", dataReader.GetStringNullAsEmpty("LocationTitle"));
AddTextTag(location, "LOCATIONDESCRIPTION", dataReader.GetStringNullAsEmpty("LocationDescription"));
AddTextTag(location, "LOCATIONZOOMLEVEL", dataReader.GetInt32NullAsZero("LocationZoomLevel").ToString());
AddTextTag(location, "LOCATIONUSERID", dataReader.GetInt32NullAsZero("LocationUserID").ToString());
AddDateXml(dataReader.GetDateTime("LocationDateCreated"), location, "LOCATIONDATECREATED");
} while (dataReader.Read());
}
AddAttribute(locations, "COUNT", count.ToString());
}
}
}