Click here to Skip to main content
15,916,601 members
Home / Discussions / C#
   

C#

 
GeneralRe: outlook automation Pin
ppp0019-Mar-05 20:55
ppp0019-Mar-05 20:55 
Generalhelp in changing background color in listview column Pin
ekynox9-Mar-05 14:59
ekynox9-Mar-05 14:59 
QuestionHow to refresh scroll bar of PrintPreviewControl Pin
sachinkalse9-Mar-05 13:56
sachinkalse9-Mar-05 13:56 
QuestionFill a dataset from different resource? Pin
Anonymous9-Mar-05 13:44
Anonymous9-Mar-05 13:44 
AnswerRe: Fill a dataset from different resource? Pin
Kodanda Pani9-Mar-05 22:52
Kodanda Pani9-Mar-05 22:52 
Questiondata set file list if exist???? Pin
Anonymous9-Mar-05 13:03
Anonymous9-Mar-05 13:03 
AnswerRe: data set file list if exist???? Pin
Christian Graus9-Mar-05 16:54
protectorChristian Graus9-Mar-05 16:54 
GeneralRe: data set file list if exist???? Pin
lornej10-Mar-05 4:21
lornej10-Mar-05 4:21 
thank you for the reply...Here is my code what is wrong?

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using ContentDistributor.Library.DocIndexing;
using ContentDistributor.Library;
using ContentDistributor.Database;
using System.Data.OleDb;
using System.Configuration.Assemblies;
using System.Configuration;
using System.Text;
using System.IO;

namespace PathDisplay
{
///
/// Summary description for Form1.
///

public class frmDisplay : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblStart;
private System.Windows.Forms.Label lblEnd;
private System.Windows.Forms.Button btnDisplay;
private System.Windows.Forms.Label lblError;
private System.Windows.Forms.TextBox txtStartDate;
private System.Windows.Forms.TextBox txtEndDate;
private string start;
private string end;
private System.Data.DataSet mysd;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;

...
static void Main()
{

Application.Run(new frmDisplay());
}

private void txtStartDate_TextChanged(object sender, System.EventArgs e)
{
start = txtStartDate.Text;
}

private void txtEndDate_TextChanged(object sender, System.EventArgs e)
{
end = txtEndDate.Text;
}

private void btnDisplay_Click(object sender, System.EventArgs e)
{
//Declare Reader
SqlDataReader rdr = null;

//
try
{
//Open Connection



// //Intialize Stored Procedure ap_DocLocPathDisp
// SqlCommand command = new SqlCommand("ap_DocLocPathDisp",oSQLConn);
// command.CommandType= CommandType.StoredProcedure;
//
//
// //Add and Declare PARAMS
// command.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = start;
// command.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = end;
// command.Parameters.Add("@PATH", SqlDbType.VarChar).Value = @"E:\Brethren images\ContentDistributor\Published\";
//
// if (oSQLConn.State.Equals(ConnectionState.Closed))
// {
// oSQLConn.Open();
// }
//
// DataSet myds = new DataSet();
// sqlDataAdapter1.Fill ( myds );
// oSQLConn.Close();
//
// DataTable myDTable = myds.Tables["DocPath"];
// SqlConnection oSQLConn = new SqlConnection();
string strCon = @"Server=ITDEV7;Database=CD30;User ID=sa;Password=sa;Trusted_Connection=True";
string strSql="select * from tbldoctest";
SqlConnection con=new SqlConnection(strCon);
con.Open();

SqlDataAdapter dadapter=new SqlDataAdapter();
dadapter.SelectCommand=new SqlCommand(strSql,con);
DataSet dset=new DataSet();
dadapter.Fill(dset);
con.Close();

this.dataGrid1.DataSource=dset;
// foreach( DataRow myDR in myDTable.Rows)
// dataGrid1.DataSource = myDTable;
// dataGrid1.DataMember = "Grid";
{

// rdr = command.ExecuteReader();
// while (rdr.Read())
// {
// string DocDateCreated = (string)rdr["DocDateCreated"];
// string DocIndexID = (string)rdr["DocIndexID"];
// string FilePath = (string)rdr["FilePath"];
// string FILE_NAME = "CheckDOCExist.txt";
// {
// if (File.Exists(FILE_NAME))
// {
// MessageBox.Show("File already exists.","Error",
// MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
//
// return;
// }
// StreamWriter sr = File.CreateText(FILE_NAME);
// //sr.WriteLine ("This is my file.");
// //sr.WriteLine ("I can write ints {0} or floats {1}, and so on.", 1, 4.2);

// sr.Close();
// oSQLConn.Close();
}



}
// }
// }
finally
{
// if (rdr != null)
// {
// rdr.Close();
// }
MessageBox.Show("Thank You","Thank You",
MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);

}

}


}
}
GeneralRe: data set file list if exist???? Pin
Christian Graus10-Mar-05 9:38
protectorChristian Graus10-Mar-05 9:38 
GeneralCalculations Pin
Robske9-Mar-05 12:55
Robske9-Mar-05 12:55 
GeneralRe: Calculations Pin
Robert Rohde9-Mar-05 21:02
Robert Rohde9-Mar-05 21:02 
GeneralComboBox Help Pin
Ctwizzy9-Mar-05 12:54
Ctwizzy9-Mar-05 12:54 
GeneralHelp on Context Sensitive Help Pin
LannieK9-Mar-05 10:41
LannieK9-Mar-05 10:41 
GeneralThreads Pin
Anonymous9-Mar-05 9:11
Anonymous9-Mar-05 9:11 
GeneralRe: Threads Pin
TylerBrinks9-Mar-05 10:20
TylerBrinks9-Mar-05 10:20 
GeneralRe: Threads Pin
TylerBrinks9-Mar-05 10:23
TylerBrinks9-Mar-05 10:23 
GeneralRe: Threads Pin
El'Cachubrey9-Mar-05 20:09
El'Cachubrey9-Mar-05 20:09 
GeneralPROBLEM: Mouse Navigation with embedded browser control Pin
AnzelVincir9-Mar-05 8:18
AnzelVincir9-Mar-05 8:18 
QuestionAccess to HTML data via COM with C#? Pin
Pikebu9-Mar-05 7:00
Pikebu9-Mar-05 7:00 
AnswerRe: Access to HTML data via COM with C#? Pin
Heath Stewart9-Mar-05 7:55
protectorHeath Stewart9-Mar-05 7:55 
QuestionIs it possible for me using session variables into a class? Pin
see079-Mar-05 6:37
see079-Mar-05 6:37 
AnswerRe: Is it possible for me using session variables into a class? Pin
TylerBrinks9-Mar-05 10:32
TylerBrinks9-Mar-05 10:32 
GeneralRe: Is it possible for me using session variables into a class? Pin
see079-Mar-05 12:09
see079-Mar-05 12:09 
GeneralRe: Is it possible for me using session variables into a class? Pin
Andy Brummer9-Mar-05 12:48
sitebuilderAndy Brummer9-Mar-05 12:48 
GeneralRe: Is it possible for me using session variables into a class? Pin
see079-Mar-05 12:53
see079-Mar-05 12:53 

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.