MCP pada 70-315 Aplikasi Web dengan C #. Bersih

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

Exam Preperation Guide

Daftar Konten retreiving melalui WebService di SharePoint 2003

Tambahkan webreference ke Lists.asmx di situs Sharepoint.

http://localhost / _vti_bin / Lists.asmx
(SharePoint maya Direktori URL / _vti_bin / Lists.asmx

menulis metode berikut dalam jejaring Anda.

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

lists.PreAuthenticate = true;
//Anda harus melewati Daftar Nama sini
String CommandText = “Karyawan Info”;
XmlNode ListCollectionNode = lists.GetListCollection();
Daftar XmlElement = (XmlElement)ListCollectionNode.SelectSingleNode(String.Format(“wss:Daftar[@ Judul = '{0}']”, CommandText), NameSpaceMgr);
jika (Daftar == null)
{
melempar ArgumentException baru(String.Format(“Daftar {0} tidak dapat ditemukan di situs {1}”, CommandText, WssSiteUrl));
}
TechListName string = List.GetAttribute(“Nama”);
Hasil data.DataTable = baru data.DataTable(“daftar”);
XmlNode ListInfoNode = lists.GetList(TechListName);
System.Text.StringBuilder fieldRefs = baru System.Text.StringBuilder();
Displaynames System.Collections.Hashtable System.Collections.Hashtable = baru();
foreach (XmlElement Lapangan di ListInfoNode.SelectNodes(“wss:Bidang / wss:Lapangan”, NameSpaceMgr))
{
jika (Field.HasChildNodes)
{
foreach (XmlElement FLD di Field.SelectNodes(“wss:Bidang / wss:Lapangan”, NameSpaceMgr))
{
FieldName string = Fld.GetAttribute(“Nama”);
FieldDisplayName string = Fld.GetAttribute(“DisplayName”);
jika (result.Columns.Contains(FieldDisplayName))
{
FieldDisplayName = FieldDisplayName + ” (” + FieldName + “)”;
}
result.Columns.Add(FieldDisplayName, TypeFromField(Lapangan));
fieldRefs.AppendFormat(“”, FieldName);
DisplayNames.Add(FieldDisplayName, FieldName);
}
}
lain
{
FieldName string = Field.GetAttribute(“Nama”);
FieldDisplayName string = Field.GetAttribute(“DisplayName”);
jika (result.Columns.Contains(FieldDisplayName))
{
FieldDisplayName = FieldDisplayName + ” (” + FieldName + “)”;
}
result.Columns.Add(FieldDisplayName, TypeFromField(Lapangan));
fieldRefs.AppendFormat(“”, FieldName);
DisplayNames.Add(FieldDisplayName, FieldName);
}
}
jika (onlySchema) kembali hasil;
Bidang XmlElement = ListInfoNode.OwnerDocument.CreateElement(“ViewFields”);
fields.InnerXml = fieldRefs.ToString();
XmlNode ItemsNode = lists.GetListItems(TechListName, “”, nol, bidang, “1000000”, nol);
// Lookup field selalu mulai dengan ID numerik, kemudian ;# dan kemudian representasi string.
// Kita biasanya hanya tertarik pada nama, jadi kami Strip ID.
CheckLookup System.Text.RegularExpressions.Regex = baru System.Text.RegularExpressions.Regex(“^ D ;#”);

foreach (XmlElement Barang di ItemsNode.SelectNodes(“rs:Tanggal / s:baris”, NameSpaceMgr))
{
data.DataRow newRow = result.NewRow();
foreach (col di result.Columns data.DataColumn)
{
jika (Item.HasAttribute(“ows_” + (tali)Displaynames[col.ColumnName]))
{
String val = Item.GetAttribute(“ows_” + (tali)Displaynames[col.ColumnName]);
jika (CheckLookup.IsMatch((tali)val))
{
string = valString pilihan sebagai String;
val = valString.Substring(valString.IndexOf(“#”) + 1);
}
// Menetapkan string ke bidang yang mengharapkan angka atau
// nilai-nilai datetime implisit akan mengkonversi mereka
newRow[dengan] = Val;
}
}
result.Rows.Add(newRow);
}
kembali hasil;
}

// Fungsi berikut ini digunakan untuk Dapatkan Namespaces

swasta XmlNamespaceManager _nsmgr statis;
swasta XmlNamespaceManager NameSpaceMgr statis
{
mendapatkan
{
jika (_nsmgr == null)
{
_nsmgr = baru XmlNamespaceManager(baru NameTable());
_nsmgr.AddNamespace(“wss”, “http://schemas.microsoft.com / Sharepoint / sabun /”);
_nsmgr.AddNamespace(“dengan”, “uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882”);
_nsmgr.AddNamespace(“dt”, “uuid:C2F41010-65B3-11d1-A29F-00AA00C14882”);
_nsmgr.AddNamespace(“rs”, “pasu:skema-microsoft-com:rowset”);
_nsmgr.AddNamespace(“dari”, “#RowsetSchema”);

}
kembali _nsmgr;
}
}
swasta Jenis TypeFromField(XmlElement lapangan)
{
beralih (field.GetAttribute(“Jenis”))
{
kasus “DateTime”:
kembali typeof(DateTime);
kasus “Bilangan bulat”:
kembali typeof(int);
kasus “Nomor”:
kembali typeof(mengapung);
standar:
kembali typeof(tali);
}
}

Pengantar

Hai,

I am New to Blogspot, I am working in following Microsoft Technologies

  • .Net FrameWork 1.1 / 2.0
  • .Net Compact Framework
  • Microsoft Windows CE
  • Smart Device Framework
  • SharePoint Portal Server 2003
  • InfoPath 2003

Check my SharePoint Blog

Salam,
Uday.