/// <summary> /// Get SQL Server Instances if possible /// </summary> private static string[] GetSQLServerInstances() { List<string> instances = new List<string>(); try { System.Data.Sql.SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance; System.Data.DataTable table = instance.GetDataSources(); foreach (System.Data.DataRow row in table.Rows) { instances.Add(row[0] + "\\" + row[1]); } } catch (Exception) { } return instances.ToArray(); }
world wide web development problems asp net php html xhtml css javascript jquery w3dproblems
Saturday, June 14, 2014
How to get list of available SQL Servers instances using C#
Generate C# class from XML
Using XSD
from visual studio tools menu run "Developer Command Prompt for VS2013" as administrator
switch to the directory where your xml file exists using "cd yourxmlfolder"
then type
then type
and your done
from visual studio tools menu run "Developer Command Prompt for VS2013" as administrator
switch to the directory where your xml file exists using "cd yourxmlfolder"
then type
d:\yourxmlfolder> xsd yourxmlfile.xml
this will generate a yourxmlfile.xsdthen type
d:\yourxmlfolder> xsd yourxmlfile.xsd /classes
and your done
Subscribe to:
Comments (Atom)