The more I read, the more I acquire, the more certain I am that I know nothing. -Voltaire
Video of an Actual Bug Triage at Microsoft
http://blogs.msdn.com/korbyp/archive/2004/10/26/248290.aspx
Visual Studio Team System Site
Visual Studio Team System Site
http://www.microsoft.com/vstudio/teamsystem
Version Control Blogs
http://blogs.msdn.com/korbyp/
http://blogs.msdn.com/buckh/
http://blogs.msdn.com/bharry/
Work Item Tracking Blogs
http://blogs.msdn.com/brianwh/
http://blogs.msdn.com/kkellyatms/
http://www.microsoft.com/vstudio/teamsystem
Version Control Blogs
http://blogs.msdn.com/korbyp/
http://blogs.msdn.com/buckh/
http://blogs.msdn.com/bharry/
Work Item Tracking Blogs
http://blogs.msdn.com/brianwh/
http://blogs.msdn.com/kkellyatms/
GMail Drive shell extension
Convert your gmail accounts into web space with this utility:
GMail Drive shell extension
Makes it as easy as drag and drop files in explorer and all files show under web UI as attachments in emails.. Also cannot drop a file of more than 10MB for now as gmail doesn't let you have more than that amount of file as attachment...
GMail Drive shell extension
Makes it as easy as drag and drop files in explorer and all files show under web UI as attachments in emails.. Also cannot drop a file of more than 10MB for now as gmail doesn't let you have more than that amount of file as attachment...
Developing .NET Custom Controls and Designers using C# (First Edition)
BlueVision, LLC - Developing .NET Custom Controls and Designers using C# (First Edition): "Developing .NET Custom Controls and Designers using C#"
Embed Excel in Winforms
Windows Forms Forums: "http://support.microsoft.com/default.aspx?scid=kb;EN-US;311765"
How to Read Hierarchical Data into a DataSet
http://www.kbalertz.com/Feedback_309487.aspx (via .NET 247)
This example uses the Customers and Orders tables that are included with the Microsoft SQL Server sample Northwind database:
1. Create a new Visual C# Console Application project. Class1.cs is created by default.
2. If the Code window is not open, right-click Class1.cs in Solution Explorer, and then click View Code.
3. Delete all of the code from the Code window.
4. Paste the following code into the Code window:
using System;
using System.Data;
using System.Data.OleDb;
namespace CSharpSample
{
///
/// Summary description for Class1
///
class Class1
{
///
/// The main entry point for the application
///
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
OleDbConnection nwindConn = new OleDbConnection("Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=northwind");
OleDbDataAdapter custDA = new OleDbDataAdapter("SHAPE {SELECT CustomerID, CompanyName FROM Customers} APPEND ({SELECT CustomerID, OrderID FROM Orders} AS Orders RELATE CustomerID TO CustomerID)", nwindConn);
DataSet custDS = new DataSet();
custDA.Fill(custDS, "Customers");
DataRow CustomerRow, OrderRow;
DataRow[] OrderRows;
String sline;
int i;
CustomerRow = custDS.Tables["Customers"].Rows[0];
Console.WriteLine("Customer Row");
Console.WriteLine("Customer ID = " + CustomerRow["CustomerId"].ToString());
Console.WriteLine("Orders for Customer ID " + CustomerRow["customerID"].ToString());
// Retrieve child rows for the order
OrderRows = CustomerRow.GetChildRows("CustomersOrders");
// Do something with the child rows collection
for (i=0; i<=OrderRows.Length-1;++i)
{
OrderRow = OrderRows[i];
sline = (OrderRow["OrderId"].ToString());
Console.WriteLine(sline);
}
Console.ReadLine();
//
}
}
}
5. Modify the connection string as appropriate for your environment.
6. Press the F5 key to build and run the project. Note that the program's output appears as follows in the Command window:
Customer Row
Customer ID = ALFKI
Orders for Customer ID ALFKI
10643
10692
10702
10835
10952
11011
7. When you are finished, press ENTER to close the Command window.
When the Fill operation is complete, the DataSet contains two tables: Customers and CustomersOrders. The CustomersOrders table represents the chaptered column. An additional column that is named Orders is added to the Customers table. An additional column that is named CustomersOrders is added to the CustomersOrders table. The Orders column in the Customers table is set automatically increment. A DataRelation that is named CustomersOrders is created by using the columns that were added to the tables with Customers as the parent table.
This example uses the Customers and Orders tables that are included with the Microsoft SQL Server sample Northwind database:
1. Create a new Visual C# Console Application project. Class1.cs is created by default.
2. If the Code window is not open, right-click Class1.cs in Solution Explorer, and then click View Code.
3. Delete all of the code from the Code window.
4. Paste the following code into the Code window:
using System;
using System.Data;
using System.Data.OleDb;
namespace CSharpSample
{
///
/// Summary description for Class1
///
class Class1
{
///
/// The main entry point for the application
///
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
OleDbConnection nwindConn = new OleDbConnection("Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=northwind");
OleDbDataAdapter custDA = new OleDbDataAdapter("SHAPE {SELECT CustomerID, CompanyName FROM Customers} APPEND ({SELECT CustomerID, OrderID FROM Orders} AS Orders RELATE CustomerID TO CustomerID)", nwindConn);
DataSet custDS = new DataSet();
custDA.Fill(custDS, "Customers");
DataRow CustomerRow, OrderRow;
DataRow[] OrderRows;
String sline;
int i;
CustomerRow = custDS.Tables["Customers"].Rows[0];
Console.WriteLine("Customer Row");
Console.WriteLine("Customer ID = " + CustomerRow["CustomerId"].ToString());
Console.WriteLine("Orders for Customer ID " + CustomerRow["customerID"].ToString());
// Retrieve child rows for the order
OrderRows = CustomerRow.GetChildRows("CustomersOrders");
// Do something with the child rows collection
for (i=0; i<=OrderRows.Length-1;++i)
{
OrderRow = OrderRows[i];
sline = (OrderRow["OrderId"].ToString());
Console.WriteLine(sline);
}
Console.ReadLine();
//
}
}
}
5. Modify the connection string as appropriate for your environment.
6. Press the F5 key to build and run the project. Note that the program's output appears as follows in the Command window:
Customer Row
Customer ID = ALFKI
Orders for Customer ID ALFKI
10643
10692
10702
10835
10952
11011
7. When you are finished, press ENTER to close the Command window.
When the Fill operation is complete, the DataSet contains two tables: Customers and CustomersOrders. The CustomersOrders table represents the chaptered column. An additional column that is named Orders is added to the Customers table. An additional column that is named CustomersOrders is added to the CustomersOrders table. The Orders column in the Customers table is set automatically increment. A DataRelation that is named CustomersOrders is created by using the columns that were added to the tables with Customers as the parent table.
5.35 How do I set the width of a column in my DataGrid?
Windows Forms FAQ - Windows Forms Datagrid: "5.35 How do I set the width of a column in my DataGrid?
To set a column width, your datagrid must be using a non-null DataGridTableStyle. Once this is in place, you can set the column width by first getting the tablestyle and then using that object to obtain a column style with which you can set the width. Here are some code snippets showing how you might do this.
//.... make sure your DataGrid is using a tablestyle
dataGrid1.DataSource = _dataSet.Tables['customers'];
DataGridTableStyle dgts = new DataGridTableStyle();
dgts.MappingName = 'customers';
dataGrid1.TableStyles.Add(dgts);
//......
//method to set a column with by colnumber
public void SetColWidth(DataGridTableStyle tableStyle, int colNum, int width)
{
try
{
tableStyle.GridColumnStyles[colNum].Width = width;
tableStyle.DataGrid.Refresh();
}
catch{} //empty catch .. do nothing
}
//....
// here is how you might call this method
private void button1_Click(object sender, System.EventArgs e)
{
DataGridTableStyle tableStyle = dataGrid1.TableStyles['customers'];
SetColWidth(tableStyle, 1, 200);
}
"
To set a column width, your datagrid must be using a non-null DataGridTableStyle. Once this is in place, you can set the column width by first getting the tablestyle and then using that object to obtain a column style with which you can set the width. Here are some code snippets showing how you might do this.
//.... make sure your DataGrid is using a tablestyle
dataGrid1.DataSource = _dataSet.Tables['customers'];
DataGridTableStyle dgts = new DataGridTableStyle();
dgts.MappingName = 'customers';
dataGrid1.TableStyles.Add(dgts);
//......
//method to set a column with by colnumber
public void SetColWidth(DataGridTableStyle tableStyle, int colNum, int width)
{
try
{
tableStyle.GridColumnStyles[colNum].Width = width;
tableStyle.DataGrid.Refresh();
}
catch{} //empty catch .. do nothing
}
//....
// here is how you might call this method
private void button1_Click(object sender, System.EventArgs e)
{
DataGridTableStyle tableStyle = dataGrid1.TableStyles['customers'];
SetColWidth(tableStyle, 1, 200);
}
"
Fill a ListView with any Dataset, and perform sorting by a Column Header in Visual C# .NET
Fill a ListView with any Dataset, and perform sorting by a Column Header in Visual C# .NET: "Fill a ListView with any Dataset, and perform
sorting by a Column Header in Visual C# .NET"
sorting by a Column Header in Visual C# .NET"
Secure ASP.NET sites from XSS
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMCh21.asp
Use the following module:
http://support.microsoft.com/kb/887289
If you think you can just hard code a few chars to prevent it, try
http://www.shocking.com/~rsnake/xss.html
Use the following module:
http://support.microsoft.com/kb/887289
If you think you can just hard code a few chars to prevent it, try
http://www.shocking.com/~rsnake/xss.html
Subscribe to:
Posts (Atom)
Ramadan - What is it?
Ramadan is one of the most important and holy months in the Islamic calendar. It is a time of fasting, prayer, and spiritual reflection fo...
-
ZipStudio - A versatile Visual Studio add-in to zip up Visual Studio solutions and projects - The Code Project - C# Programming
-
TargetProcess - Agile Project Management & Bug Tracking Software | Download (Project Management Software, Project Tracking, Bug Tracking...