Click here to Skip to main content
15,898,708 members
Home / Discussions / C#
   

C#

 
AnswerRe: Table's definition... Pin
dan!sh 13-May-08 22:48
professional dan!sh 13-May-08 22:48 
GeneralRe: Table's definition... Pin
Adeel Chaudhry13-May-08 23:49
Adeel Chaudhry13-May-08 23:49 
GeneralRe: Table's definition... Pin
dan!sh 14-May-08 0:03
professional dan!sh 14-May-08 0:03 
AnswerRe: Table's definition... Pin
sunspeed14-May-08 3:06
sunspeed14-May-08 3:06 
AnswerRe: Table's definition... Pin
Pete O'Hanlon14-May-08 3:07
mvePete O'Hanlon14-May-08 3:07 
QuestionExport data from gridview to csv file Pin
gckumar13-May-08 21:49
gckumar13-May-08 21:49 
AnswerRe: Export data from gridview to csv file [modified] Pin
dan!sh 13-May-08 22:15
professional dan!sh 13-May-08 22:15 
AnswerRe: Export data from gridview to csv file Pin
ctlqt1213-May-08 22:23
ctlqt1213-May-08 22:23 
Hope this will help you :

private void OnExportGridToCSV(object sender, System.EventArgs e)
{
	// Create the CSV file to which grid data will be exported.
	StreamWriter sw = new StreamWriter(Server.MapPath("~/GridData.txt"), false);

	// First we will write the headers.
	DataTable dt = m_dsProducts.Tables[0];
	int iColCount = dt.Columns.Count;
	for(int i = 0; i < iColCount; i++)
	{
		sw.Write(dt.Columns[i]);
		if (i < iColCount - 1)
		{
			sw.Write(",");
		}
	}
	sw.Write(sw.NewLine);

	// Now write all the rows.
	foreach (DataRow dr in dt.Rows)
	{
		for (int i = 0; i < iColCount; i++)
		{
			if (!Convert.IsDBNull(dr[i]))
			{
				sw.Write(dr[i].ToString());
			}
			if ( i < iColCount - 1)
			{
				sw.Write(",");
			}
		}
		sw.Write(sw.NewLine);
	}
	sw.Close();
}

QuestionImages Pin
senthilsstil13-May-08 21:14
senthilsstil13-May-08 21:14 
AnswerRe: Images Pin
Christian Graus13-May-08 21:19
protectorChristian Graus13-May-08 21:19 
GeneralRe: Images Pin
senthilsstil13-May-08 21:25
senthilsstil13-May-08 21:25 
GeneralRe: Images Pin
Christian Graus13-May-08 21:30
protectorChristian Graus13-May-08 21:30 
GeneralRe: Images Pin
dan!sh 13-May-08 21:34
professional dan!sh 13-May-08 21:34 
AnswerRe: Images Pin
leckey14-May-08 3:05
leckey14-May-08 3:05 
QuestionDrag&Drop under Vista Pin
baerten13-May-08 21:11
baerten13-May-08 21:11 
AnswerRe: Drag&Drop under Vista Pin
Member 363066820-May-08 5:58
Member 363066820-May-08 5:58 
GeneralRe: Drag&Drop under Vista Pin
baerten20-May-08 21:27
baerten20-May-08 21:27 
GeneralRe: Drag&Drop under Vista Pin
Member 363066823-Jun-08 2:58
Member 363066823-Jun-08 2:58 
GeneralRe: Drag&Drop under Vista Pin
baerten23-Jun-08 3:12
baerten23-Jun-08 3:12 
GeneralRe: Drag&Drop under Vista Pin
Member 363066823-Jun-08 4:20
Member 363066823-Jun-08 4:20 
Questiondraw text in richtextbox.. Pin
kamalesh574313-May-08 20:33
kamalesh574313-May-08 20:33 
AnswerRe: draw text in richtextbox.. Pin
Christian Graus13-May-08 20:40
protectorChristian Graus13-May-08 20:40 
GeneralRe: draw text in richtextbox.. Pin
kamalesh574313-May-08 21:50
kamalesh574313-May-08 21:50 
GeneralRe: draw text in richtextbox.. Pin
Christian Graus13-May-08 22:27
protectorChristian Graus13-May-08 22:27 
QuestionFull Progressbar within Statusbar Pin
Michael Sync13-May-08 20:17
Michael Sync13-May-08 20:17 

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.