Click here to Skip to main content
15,848,483 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Advice needed Pin
Graham Bradshaw23-Jul-08 10:41
Graham Bradshaw23-Jul-08 10:41 
GeneralRe: SQL Advice needed Pin
StevenWalsh23-Jul-08 10:49
StevenWalsh23-Jul-08 10:49 
GeneralRe: SQL Advice needed Pin
Pete O'Hanlon23-Jul-08 10:52
subeditorPete O'Hanlon23-Jul-08 10:52 
GeneralRe: SQL Advice needed Pin
GuyThiebaut23-Jul-08 11:28
professionalGuyThiebaut23-Jul-08 11:28 
GeneralRe: SQL Advice needed Pin
SomeGuyThatIsMe24-Jul-08 3:41
SomeGuyThatIsMe24-Jul-08 3:41 
GeneralRe: SQL Advice needed Pin
StevenWalsh24-Jul-08 5:40
StevenWalsh24-Jul-08 5:40 
GeneralRe: SQL Advice needed Pin
SomeGuyThatIsMe24-Jul-08 5:47
SomeGuyThatIsMe24-Jul-08 5:47 
QuestionCreating Reports using DataSet Pin
Reality Strikes23-Jul-08 6:19
Reality Strikes23-Jul-08 6:19 
I'm having an access database table which consists of 4 different columns Day, Month, and Year-1 and Year-2 (e.g 22-July-2008 is present in Database as: 07, 22, 20, 08) as columns. So I have added a new Date column in a newly created Dataset which concatenates all these 4 fields and show it as a single date field. But now the problem is that, I'm not getting anywhere with how to link this newly created dataset with my Crystal Report.

Thanking you in anticipation.

My C#.Net code is as shown below:

private void button1_Click(object sender, System.EventArgs e)
{
	try
	{
		// Code to get data from database
		myCon.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\as400.mdb";						
		myCon.Open();

		string sqlQuery = "Select [CLNT#], CNAME, [CSS#], CADMHH, CADMYY, CADMMM, CADMDD, CSEX from SAMFILE_CLIENTP";
		myAdp = new OleDbDataAdapter(sqlQuery, myCon);
						
		// Create a Dataset and using DataAdapter to fill it
		PIN_DataSet PDS = new PIN_DataSet();
		PDS.Clear();
		myAdp.Fill(PDS,"SAMFILE_CLIENTP");

		//START - Added new DataSet for concatenating date fields
		DataSet newPDS = new DataSet();
		newPDS = PDS.Copy();
								
		DataColumn dCol = new DataColumn(newPDS.Tables[0].Columns.Add("DT", typeof(String)).ToString());
		for(Int32 i = 0; i < newPDS.Tables[0].Rows.Count; i++)
		{
			DataRow row = newPDS.Tables[0].Rows[i];
		 	row["DT"] = row["CADMMM"].ToString() + "/" + row["CADMDD"].ToString() + "/" + row["CADMHH"].ToString() + row["CADMYY"].ToString();
		}
		//END - Added new DataSet for concatenating date fields	
		

		// Create a CrystalReport1 object
		PIN_Crystal_Report myReport = new PIN_Crystal_Report();


		// Set the DataSource of the report
		myReport.SetDataSource(PDS);


		// Set the Report Source to ReportView 
		crystalReportViewer1.ReportSource = myReport;
	}
	catch(Exception obj)
	{
		MessageBox.Show(obj.Message, "X'eption");
	}
}

AnswerRe: Creating Reports using DataSet Pin
Wendelius23-Jul-08 7:20
mentorWendelius23-Jul-08 7:20 
GeneralRe: Creating Reports using DataSet Pin
Verghese25-Jul-08 5:57
Verghese25-Jul-08 5:57 
GeneralRe: Creating Reports using DataSet Pin
Wendelius25-Jul-08 10:37
mentorWendelius25-Jul-08 10:37 
QuestionSELECT command Pin
Reality Strikes23-Jul-08 5:33
Reality Strikes23-Jul-08 5:33 
AnswerRe: SELECT command Pin
Harvey Saayman23-Jul-08 5:46
Harvey Saayman23-Jul-08 5:46 
GeneralRe: SELECT command Pin
Reality Strikes23-Jul-08 6:00
Reality Strikes23-Jul-08 6:00 
GeneralRe: SELECT command Pin
Harvey Saayman23-Jul-08 6:57
Harvey Saayman23-Jul-08 6:57 
QuestionAttaching database Pin
hadad22-Jul-08 22:37
hadad22-Jul-08 22:37 
AnswerRe: Attaching database Pin
Colin Angus Mackay23-Jul-08 4:34
Colin Angus Mackay23-Jul-08 4:34 
AnswerRe: Attaching database Pin
Vimalsoft(Pty) Ltd23-Jul-08 6:58
professionalVimalsoft(Pty) Ltd23-Jul-08 6:58 
Questionsql server data transferring?? Pin
Dotnetkanna22-Jul-08 22:34
Dotnetkanna22-Jul-08 22:34 
QuestionMultiple processes with the same ID Pin
JacquesDP22-Jul-08 22:05
JacquesDP22-Jul-08 22:05 
AnswerRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 7:03
mentorWendelius23-Jul-08 7:03 
QuestionRe: Multiple processes with the same ID Pin
JacquesDP23-Jul-08 19:18
JacquesDP23-Jul-08 19:18 
AnswerRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 19:43
mentorWendelius23-Jul-08 19:43 
GeneralRe: Multiple processes with the same ID Pin
JacquesDP23-Jul-08 19:47
JacquesDP23-Jul-08 19:47 
GeneralRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 19:49
mentorWendelius23-Jul-08 19:49 

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.