Click here to Skip to main content
15,920,383 members
Home / Discussions / C#
   

C#

 
QuestionWeird form update problem... Pin
Drew Stainton11-Nov-05 11:15
Drew Stainton11-Nov-05 11:15 
AnswerRe: Weird form update problem... Pin
leppie11-Nov-05 19:08
leppie11-Nov-05 19:08 
GeneralRe: Weird form update problem... Pin
Drew Stainton11-Nov-05 19:15
Drew Stainton11-Nov-05 19:15 
QuestionNeed some help with regex Pin
FreeClimber11-Nov-05 9:53
FreeClimber11-Nov-05 9:53 
AnswerRe: Need some help with regex Pin
leppie11-Nov-05 10:51
leppie11-Nov-05 10:51 
GeneralRe: Need some help with regex Pin
FreeClimber11-Nov-05 11:25
FreeClimber11-Nov-05 11:25 
QuestionCreating a new table of smaller dataset. Pin
zaboboa11-Nov-05 9:29
zaboboa11-Nov-05 9:29 
AnswerRe: Creating a new table of smaller dataset. Pin
rudy.net11-Nov-05 11:04
rudy.net11-Nov-05 11:04 
I will share a class that I use in these cases. Note that this class is used as part of a select query that I normally use in my code, so you may modify as needed.
<br />
	public class SelectCommand<br />
	{<br />
		StringCollection columnNames = new StringCollection();<br />
		public SelectCommand(string selectQuery)<br />
		{<br />
			string[] tmp = selectQuery.Split(new char[]{','});<br />
			for (int i = 0; i < tmp.Length; i++)<br />
				columnNames.Add(tmp[i].Trim());<br />
		}<br />
<br />
		public DataTable ExecuteSelect(DataTable sourceTable)<br />
		{<br />
			DataTable dt = new DataTable(sourceTable.TableName);<br />
<br />
			DataColumn newCol;<br />
			foreach (DataColumn col in sourceTable.Columns)<br />
			{<br />
				if (columnNames.Contains(col.ColumnName))<br />
				{<br />
					newCol = new DataColumn(col.ColumnName, col.DataType, col.Expression);<br />
					dt.Columns.Add(newCol);<br />
				}			<br />
			}<br />
<br />
			DataRow newRow;<br />
			foreach (DataRow row in sourceTable.Rows)<br />
			{<br />
				newRow = dt.NewRow();<br />
				foreach (string colName in columnNames)<br />
				{<br />
					newRow[colName] = row[colName];<br />
				}<br />
				dt.Rows.Add(newRow);<br />
			}<br />
<br />
			return dt;<br />
		}<br />
	}<br />

QuestionHow to rename mapped drive? Pin
Shumsky11-Nov-05 8:51
Shumsky11-Nov-05 8:51 
QuestionBinary Formatter problems Pin
Marc Clifton11-Nov-05 8:37
mvaMarc Clifton11-Nov-05 8:37 
AnswerRe: Binary Formatter problems Pin
leppie11-Nov-05 10:47
leppie11-Nov-05 10:47 
AnswerRe: Binary Formatter problems Pin
Joe Woodbury11-Nov-05 20:30
professionalJoe Woodbury11-Nov-05 20:30 
QuestionWhy is there a ContextMenu Property on TreeView? Pin
SeanCM11-Nov-05 8:35
SeanCM11-Nov-05 8:35 
AnswerRe: Why is there a ContextMenu Property on TreeView? Pin
SeanCM11-Nov-05 8:46
SeanCM11-Nov-05 8:46 
AnswerRe: Why is there a ContextMenu Property on TreeView? Pin
Colin Angus Mackay11-Nov-05 23:38
Colin Angus Mackay11-Nov-05 23:38 
GeneralRe: Why is there a ContextMenu Property on TreeView? Pin
SeanCM14-Nov-05 6:33
SeanCM14-Nov-05 6:33 
Questionsidebar Pin
faviochilo11-Nov-05 8:26
faviochilo11-Nov-05 8:26 
AnswerRe: sidebar Pin
leppie11-Nov-05 10:55
leppie11-Nov-05 10:55 
QuestionCreating a popup from Pin
naglbitur11-Nov-05 7:28
naglbitur11-Nov-05 7:28 
AnswerRe: Creating a popup from Pin
Wjousts11-Nov-05 7:55
Wjousts11-Nov-05 7:55 
GeneralRe: Creating a popup from Pin
naglbitur11-Nov-05 9:36
naglbitur11-Nov-05 9:36 
GeneralRe: Creating a popup from Pin
Wjousts11-Nov-05 10:59
Wjousts11-Nov-05 10:59 
Questionsend webcam stream over tcp ip Pin
toan198111-Nov-05 7:15
toan198111-Nov-05 7:15 
QuestionEventInfo.GetRaiseMethod() - anyone made it work? Pin
vSoares11-Nov-05 6:37
professionalvSoares11-Nov-05 6:37 
AnswerRe: EventInfo.GetRaiseMethod() - anyone made it work? Pin
leppie11-Nov-05 7:07
leppie11-Nov-05 7:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.