Click here to Skip to main content
15,886,919 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Advice needed Pin
Graham Bradshaw23-Jul-08 9:41
Graham Bradshaw23-Jul-08 9:41 
GeneralRe: SQL Advice needed Pin
StevenWalsh23-Jul-08 9:49
StevenWalsh23-Jul-08 9:49 
GeneralRe: SQL Advice needed Pin
Pete O'Hanlon23-Jul-08 9:52
mvePete O'Hanlon23-Jul-08 9:52 
GeneralRe: SQL Advice needed Pin
GuyThiebaut23-Jul-08 10:28
professionalGuyThiebaut23-Jul-08 10:28 
GeneralRe: SQL Advice needed Pin
SomeGuyThatIsMe24-Jul-08 2:41
SomeGuyThatIsMe24-Jul-08 2:41 
GeneralRe: SQL Advice needed Pin
StevenWalsh24-Jul-08 4:40
StevenWalsh24-Jul-08 4:40 
GeneralRe: SQL Advice needed Pin
SomeGuyThatIsMe24-Jul-08 4:47
SomeGuyThatIsMe24-Jul-08 4:47 
QuestionCreating Reports using DataSet Pin
Reality Strikes23-Jul-08 5:19
Reality Strikes23-Jul-08 5: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 6:20
mentorWendelius23-Jul-08 6:20 
GeneralRe: Creating Reports using DataSet Pin
Verghese25-Jul-08 4:57
Verghese25-Jul-08 4:57 
GeneralRe: Creating Reports using DataSet Pin
Wendelius25-Jul-08 9:37
mentorWendelius25-Jul-08 9:37 
QuestionSELECT command Pin
Reality Strikes23-Jul-08 4:33
Reality Strikes23-Jul-08 4:33 
AnswerRe: SELECT command Pin
Harvey Saayman23-Jul-08 4:46
Harvey Saayman23-Jul-08 4:46 
GeneralRe: SELECT command Pin
Reality Strikes23-Jul-08 5:00
Reality Strikes23-Jul-08 5:00 
GeneralRe: SELECT command Pin
Harvey Saayman23-Jul-08 5:57
Harvey Saayman23-Jul-08 5:57 
QuestionAttaching database Pin
hadad22-Jul-08 21:37
hadad22-Jul-08 21:37 
AnswerRe: Attaching database Pin
Colin Angus Mackay23-Jul-08 3:34
Colin Angus Mackay23-Jul-08 3:34 
AnswerRe: Attaching database Pin
Vimalsoft(Pty) Ltd23-Jul-08 5:58
professionalVimalsoft(Pty) Ltd23-Jul-08 5:58 
Questionsql server data transferring?? Pin
Dotnetkanna22-Jul-08 21:34
Dotnetkanna22-Jul-08 21:34 
QuestionMultiple processes with the same ID Pin
JacquesDP22-Jul-08 21:05
JacquesDP22-Jul-08 21:05 
AnswerRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 6:03
mentorWendelius23-Jul-08 6:03 
QuestionRe: Multiple processes with the same ID Pin
JacquesDP23-Jul-08 18:18
JacquesDP23-Jul-08 18:18 
AnswerRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 18:43
mentorWendelius23-Jul-08 18:43 
GeneralRe: Multiple processes with the same ID Pin
JacquesDP23-Jul-08 18:47
JacquesDP23-Jul-08 18:47 
GeneralRe: Multiple processes with the same ID Pin
Wendelius23-Jul-08 18:49
mentorWendelius23-Jul-08 18: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.