XML support is integrated into all the components in SQL Server.
Search This Blog
Thursday, October 29, 2015
Tuesday, October 27, 2015
Saturday, October 17, 2015
'cmake' is not recognized as an internal or external command error
'cmake' is not recognized as an internal or external command
Solution:
Add the path to system variables Path
Solution:
Add the path to system variables Path
Etichete:
cmake
Thursday, October 15, 2015
Visual Studio show Decrease Increase Line Indent Buttons
Visual Studio > Decrease/Increase Line Indent buttons
Go o the toolbar and press:
Go o the toolbar and press:
than check Decrease/Increase Line Indent:
Etichete:
Visual Studio
Wednesday, October 7, 2015
Find max value of a column in a DataTable c#
C# > System.Data > DataTable > Max Value
Find max value of a column in a DataTable C#.
var maxValue = DataTable1.AsEnumerable().Max(r => r.Field<double>("value"));
Find max value of a column in a DataTable C#.
var maxValue = DataTable1.AsEnumerable().Max(r => r.Field<double>("value"));
Etichete:
c#
Thursday, October 1, 2015
Telerik report bind to DataTable and add a sample calculated field
Telerik > Reporting > Bind to DataTable
Example
Bind to DataTable and add a sample calculated field.
Example
Bind to DataTable and add a sample calculated field.
string connString = "Data Source=(local)\\SQLEXPRESS;Initial Catalog=HR;Integrated Security=True";
string cmdText = "SELECT FirstName, LastName FROM Person;";
SqlDataAdapter da = new SqlDataAdapter(cmdText, connString);
DataTable dt = new DataTable();
dataAdapter.Fill(dt);
Telerik.Reporting.ObjectDataSource ods = new Telerik.Reporting.ObjectDataSource();
ods.DataSource = dt;
ods.CalculatedFields.Add(new Telerik.Reporting.CalculatedField("FullName", typeof(string), "=Fields.FirstName + ' ' + Fields. LastName "));
Telerik.Reporting.Report rpt = new Telerik.Reporting.Report();
rpt.DataSource = objectDataSource;
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = rpt;
reportViewer1.ReportSource = reportSource;
reportViewer1.RefreshReport();
Etichete:
Telerik
Monday, September 28, 2015
Choose Visual Basic Example
VB.NET > Functions > Choose
Returns a member of the list passed in Choice().
It is based on the value of Index. The first member of the list is selected when Index is 1.
Example
Dim choice = Choose(2, "val1", "val2", "val2") // "val2"
Returns a member of the list passed in Choice().
It is based on the value of Index. The first member of the list is selected when Index is 1.
Example
Dim choice = Choose(2, "val1", "val2", "val2") // "val2"
Etichete:
VB.NET
Thursday, September 24, 2015
Appends text to a file C#
C# > Files > File Class > AppendText
Appends text to an existing file or create a new file if the specified file does not exist.
Example
using(System.IO.StreamWriter sw = System.IO.File.AppendText(@"c:\log.txt"))
{sw.WriteLine("logline");
}
Etichete:
c#
Tuesday, September 15, 2015
Convert to double TimeSpan C#
C# > System > TimeSpan Structure
TimeSpan represents a time structure.
Examples
1. Convert to double
TimeSpan represents a time structure.
Examples
1. Convert to double
TimeSpan ts = TimeSpan.FromMinutes(12.45);
double time = ts.TotalMinutes;
Etichete:
c#
Friday, August 14, 2015
SOUNDEX SQL Server Example
SQL Server > Built-in Functions > SOUNDEX
SOUNDEX converts an alphanumeric string to a four-character code that is based on how the string sounds when spoken.
Example
SOUNDEX converts an alphanumeric string to a four-character code that is based on how the string sounds when spoken.
Example
SELECT SOUNDEX ('Jan'), SOUNDEX ('Jane');
Result:
(No column name) (No column name)
J500 J500
Etichete:
SQL Server
TRY_CAST SQL Server Example
SQL Server > Built-in Functions > TRY_CAST
Try to cast a value to the specified data type.
If the cast not succeeds returns null.
Example
Cast succeeded
Try to cast a value to the specified data type.
If the cast not succeeds returns null.
Example
SELECT
CASE WHEN TRY_CAST('1' AS float) IS NULL
THEN 'Cast failed'
ELSE 'Cast succeeded'
END AS Result;
Result
SELECT
CASE WHEN TRY_CAST('xx' AS float) IS NULL
THEN 'Cast failed'
ELSE 'Cast succeeded'
END AS Result;
Result
Cast failed
Etichete:
SQL Server
Subscribe to:
Posts (Atom)