MCP an 70-315 C # Garbia dituzten Web aplikazioak

I have Successfully Passed my First Microsoft Certification on 70-315 for achievement of
MCP in followin Paper:

Developing and Implementing Web Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET

To Undergo Certifications

Azterketa Preperation gida

Zerrendaren edukia Retreiving SharePoint en WebService bidez 2003

Gehitu webreference du Lists.asmx izateko SharePoint gunean.

http://localhost / _vti_bin / Lists.asmx
(SharePoint Directory birtuala URL / _vti_bin / Lists.asmx

Zure webservice ere, metodo hauek idatzi.

pribatua data.DataTable GetDataTableFromWSS(bool onlySchema)
{
katea WssSiteUrl = http://192.168.111.21;
katea WssSiteUrl = ConfigurationSettings.AppSettings[“WssSiteUrl”];
WssSite.Lists zerrendak = WssSite.Lists berria();
lists.Url = WssSiteUrl + “_vti_bin / Lists.asmx”;
lists.Credentials = System.Net.CredentialCache.DefaultCredentials;

lists.PreAuthenticate = true;
//Hemen pasatzeko zerrenda Izena duzu
katea CommandText = “Langilearen Info”;
XmlNode ListCollectionNode = lists.GetListCollection();
XmlElement List = (XmlElement)ListCollectionNode.SelectSingleNode(String.Format(“wss:Zerrenda[@ Title = '{0}']”, CommandText), NameSpaceMgr);
bada (Zerrendak == null)
{
ArgumentException berria bota(String.Format(“Zerrenda {0} litezke gunean aurkitzen ez den kasuetan {1}”, CommandText, WssSiteUrl));
}
katea TechListName = List.GetAttribute(“Izena”);
data.DataTable emaitza = data.DataTable berria(“Zerrenda”);
XmlNode ListInfoNode = lists.GetList(TechListName);
System.Text.StringBuilder fieldRefs = System.Text.StringBuilder berria();
System.Collections.Hashtable DisplayNames = System.Collections.Hashtable berria();
foreach (XmlElement Eremu ListInfoNode.SelectNodes saioa(“wss:Fields / wss:Eremua”, NameSpaceMgr))
{
bada (Field.HasChildNodes)
{
foreach (XmlElement Fld Field.SelectNodes saioa(“wss:Fields / wss:Eremua”, NameSpaceMgr))
{
katea fieldname = Fld.GetAttribute(“Izena”);
katea FieldDisplayName = Fld.GetAttribute(“DisplayName”);
bada (result.Columns.Contains(FieldDisplayName))
{
FieldDisplayName = FieldDisplayName + ” (” + Fieldname + “)”;
}
result.Columns.Add(FieldDisplayName, TypeFromField(Eremua));
fieldRefs.AppendFormat(“”, Fieldname);
DisplayNames.Add(FieldDisplayName, Fieldname);
}
}
beste
{
katea fieldname = Field.GetAttribute(“Izena”);
katea FieldDisplayName = Field.GetAttribute(“DisplayName”);
bada (result.Columns.Contains(FieldDisplayName))
{
FieldDisplayName = FieldDisplayName + ” (” + Fieldname + “)”;
}
result.Columns.Add(FieldDisplayName, TypeFromField(Eremua));
fieldRefs.AppendFormat(“”, Fieldname);
DisplayNames.Add(FieldDisplayName, Fieldname);
}
}
bada (onlySchema) bueltan emaitza;
XmlElement eremuak = ListInfoNode.OwnerDocument.CreateElement(“ViewFields”);
fields.InnerXml = fieldRefs.ToString();
XmlNode ItemsNode = lists.GetListItems(TechListName, “”, null, eremuak, “1000000”, null);
// Lookup eremuak beti zenbakizko ID batekin hasi, Orduz ;# eta, ondoren, kate irudikapena.
// Normalean, izena bakarrik interesatzen zaigu, beraz ID kenduko dugu.
System.Text.RegularExpressions.Regex CheckLookup = System.Text.RegularExpressions.Regex berria(“^ D ;#”);

foreach (XmlElement ItemsNode.SelectNodes ere Item(“rs:data / z:ilara”, NameSpaceMgr))
{
data.DataRow newRow = result.NewRow();
foreach (result.Columns in col data.DataColumn)
{
bada (Item.HasAttribute(“ows_” + (katea)DisplayNames[col.ColumnName]))
{
katea val = Item.GetAttribute(“ows_” + (katea)DisplayNames[col.ColumnName]);
bada (CheckLookup.IsMatch((katea)h))
{
valString kate = val As String;
val = valString.Substring(valString.IndexOf(“#”) + 1);
}
// Kate bat zenbakiekin edo espero duten eremu batera
// datetime balioak inplizituki egingo bihur
newRow[Honekin] = H;
}
}
result.Rows.Add(newRow);
}
bueltan emaitza;
}

// Hurrengo funtzioa Talde Izen erabiltzen da

pribatua estatikoan XmlNamespaceManager _nsmgr;
pribatua estatikoan XmlNamespaceManager NameSpaceMgr
{
lortu
{
bada (_nsmgr == null)
{
_nsmgr = XmlNamespaceManager berria(berria NameTable());
_nsmgr.AddNamespace(“wss”, “http://schemas.microsoft.com/sharepoint/soap/”);
_nsmgr.AddNamespace(“s”, “uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882”);
_nsmgr.AddNamespace(“dt”, “uuid:C2F41010-65B3-11d1-A29F-00AA00C14882”);
_nsmgr.AddNamespace(“rs”, “urn:eskemarik-microsoft-com:rowset”);
_nsmgr.AddNamespace(“of”, “#RowsetSchema”);

}
itzultzeko _nsmgr;
}
}
Mota pribatua TypeFromField(XmlElement eremu)
{
switch (field.GetAttribute(“Mota”))
{
Kasu “Kolore”:
itzultzeko typeof(Kolore);
Kasu “Integer”:
itzultzeko typeof(int);
Kasu “Zenbakia”:
itzultzeko typeof(karroza);
Lehenespenez:
itzultzeko typeof(katea);
}
}

Sarrera

Hi,

Naiz New den Blogspot, Microsoft Technologies honako ari naiz lanean

  • .NET Framework 1.1 / 2.0
  • .Compact Framework garbiak
  • Microsoft Windows CE
  • Gailu Smart Esparru
  • SharePoint Portal Server 2003
  • InfoPath 2003

Begiratu nire SharePoint Blog

Regards,
Uday.