Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

Verghese

@Verghese
About
Posts
53
Topics
19
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Reg:
    V Verghese

    I seriously think that he wants to write a C# code to detect plug-ins in the windows registry, look bro, thts simple, do u know how to use google..........start from scratch and someone will help u out if u r struck.........we dont provide ready made solutions.........do ur homework first.......

    C# csharp dotnet windows-admin question announcement

  • Venue booking code in vb.net
    V Verghese

    Expert Coming wrote:

    If you need help fixing your car you don't expect me to give you the car to fix do you?

    PERFECT.............and sounds more feasible too........... :)

    C# csharp help

  • Passing value from the form
    V Verghese

    This was exactly what I tried b4 posting. I stored the value from textbox into a String variable and then Parsed it into DateTime as it's shown in the code. But all this time I was getting errors b'coz the name of my Textbox was same as that of the variable I used for used for storing the date. So, I changed the variable name and its UP and RUNNING. Thanks a lot to everyone :)

    C# help question

  • Passing value from the form
    V Verghese

    It gives me a compile error : 'System.DateTime' does not contain a definition for 'Text'

    C# help question

  • Passing value from the form
    V Verghese

    When I'm using the following code, everything is Okay.

    DateTime startDate = DateTime.Parse("05/01/2007");
    DateTime endDate = DateTime.Parse("06/01/2007");

    But when I try to pass the date value directly from the text box, it gives me error. How can I pass the date directly into the code from textbox. Any suggestions. Thanks

    C# help question

  • Problem with Date Validation
    V Verghese

    Guffa wrote:

    Why do you have the date stored in four columns in the first place? That makes it mostly useless...

    that's infact a million $$$ question...........the dates stored in AS400 (mainframes) systems are in this format only...........and moreover, they dont have a date field as such.......... (i said wtf???? wen i first saw this format, thn i learned its Mainframes).......... :) anyway, with couple of changes in the code i've done the date validation.........but its showing all records in the report............i don't want it that way............date validation is working fine, but its working only on the "ADM_DATE" column......... hold on, i'll explain.........suppose a row of record falls within the given date range, then in the report as expected its displaying the entire row............but when its not falling within the date range, still its displaying the row of record, but keeping the date field as empty............ did i explained the situation clearly..........pls see the code below:

    for(Int32 i = 0; i < newPDS.Tables[0].Rows.Count; i++)
    {
    row = newPDS.Tables[0].Rows[i];
    string stringConCatDate;
    DateTime startDate = DateTime.Parse("07/28/1960");
    DateTime endDate = DateTime.Parse("02/14/1982");

    stringConCatDate = row\["CADMMM"\] + "/" + row\["CADMDD"\] + "/" + row\["CADMHH"\] + row\["CADMYY"\];
    
    DateTime dtConCatDate = DateTime.Parse(stringConCatDate);
    
    if (dtConCatDate > startDate && dtConCatDate < endDate)
    {
    	row\["ADM\_DATE"\] = stringConCatDate;
    }
    

    }

    myReport.SetDataSource(newPDS.Tables["TABLE_1"]);

    C# help tutorial

  • Problem with Date Validation
    V Verghese

    Below pasted is the piece of code where I want to display records based on the date range. Let's say I have a startDate(01/15/2007) and an endDate(01/15/2008): Can anyone give me some inputs as how to handle date validation in this code. I mean the place where I'm concatenating those 4 columns and getting a single date column row by row, I want to have this date validation. If it falls within this range, it shud add to the DataSet as a new row or else no.

    DataSet newPDS = new DataSet();
    DataRow row = new DataRow();

    //ADM_DATE is DateTime field in DataSet

    //Checking whether column is already created or not
    if (newPDS.Tables[0].Columns["ADM_DATE"]== null)

    {
    DataColumn dCol = new DataColumn(newPDS.Tables[0].Columns.Add("ADM_DATE", typeof(DateTime), "").ToString());
    }

    for(Int32 i = 0; i < newPDS.Tables[0].Rows.Count; i++)
    {
    row = newPDS.Tables[0].Rows[i];
    //Concatenating 4 columns and filling up a date column (ADM_DATE) row by row
    row["ADM_DATE"] = row["CADMMM"] + "/" + row["CADMDD"] + "/" + row["CADMHH"] + row["CADMYY"];
    }

    Any help would be appreciated. Thanking you in anticipation.

    modified on Wednesday, August 6, 2008 3:34 PM

    C# help tutorial

  • How to use "SELECT" statement on DataTables [modified]
    V Verghese

    Thanks Mika. Just now I learned that, ADO.Net expressions do not support the "BETWEEN" keyword (it's showing an error as : Expression contains unsupported operator"BETWEEN").......so I just break it up into clauses with an "AND" as

    "ADM_DATE > StartDate AND ADM_DATE < EndDate"

    And when I'm using the above lines, its showing up the database connection popup, where it asks for Server Name, Database Type, LoginId, Password etc. That means that its still looking for the Crystal Reports datasource as DataSet's Table. My previously working Crystal Reports datasource expression was like this :

    myReport.SetDataSource(newPDS.Tables["SAMFILE_CLIENTP"]);

    where : newPDS - DataSet SAMFILE_CLIENTP - DataSet Table Any idea ???

    C# tutorial

  • How to use "SELECT" statement on DataTables [modified]
    V Verghese

    I want to use the "SELECT " statement on DataTable, which fetches records between these 2 date ranges: StartDate : 01-01-2007 and, EndDate : 01-01-2008 The code is as follows:

    if (newPDS.Tables[0].Columns["ADM_DATE"]== null)
    {
    DataColumn dCol = new DataColumn(newPDS.Tables[0].Columns.Add("ADM_DATE", typeof(DateTime), "").ToString());
    }

    for(Int32 i = 0; i < newPDS.Tables[0].Rows.Count; i++)
    {
    row = newPDS.Tables[0].Rows[i];
    row["ADM_DATE"] = row["CADMMM"] + "/" + row["CADMDD"] + "/" + row["CADMHH"] + row["CADMYY"];
    DateTime newDT = new DateTime();
    newDT = Convert.ToDateTime(row["ADM_DATE"]).Date;
    row["ADM_DATE"] = newDT.ToShortDateString();
    string newQuery = "ADM_DATE between StartDate and EndDate";
    newDR = myTable.Select(newQuery);
    }

    myReport.SetDataSource(newDR);
    crystalReportViewer1.ReportSource = myReport;

    Thanking you in anticipation.

    modified on Tuesday, August 5, 2008 3:33 PM

    C# tutorial

  • Convert DateTime to Date
    V Verghese

    dear friend, i didnt knew u were this caring...........but dont be in the assumption that it was way too funny...........

    C# help

  • Convert DateTime to Date
    V Verghese

    Vikas, whn i try this line

    row["ADM_DATE"] = newDT.ToShortDateString().Remove(9)

    it's throwing up this error:

    "No overload for method 'Remove' takes '1' arguments"

    C# help

  • Convert DateTime to Date
    V Verghese

    Dear........this is not my design, its the way how dates are always stored in AS400 Mainframe systems. I'm working on IBM iSeries Mainframe server. I have not much options on choosing the database. Did I cleared your doubt???

    C# help

  • Convert DateTime to Date
    V Verghese

    Hi Vikas, if the task wud have been just to display the data on the report, thn it was easy. See here's just the gist, my database table has dates splitted in 4 columns like DD, MM, CC, YY. Then using DataSet I'm concatenating these fields. And I'm concatenating it, bcoz I want to display the records within a particular date range. And for tht date comparison thing, it has to be in the date format and not string format. And this comparison has to be done at the code level and not at the database level, since database doesnt have anything like a date field.

    C# help

  • Convert DateTime to Date
    V Verghese

    Guffa, I understand that, storing a value as string cannot be displayed in any other formats unless until we parse it into some other formats. But that's the reason why I'm parsing it into DateTime format. see the code one again......

    row["ADMISSION_DATE"] = DateTime.Parse(row["MM"].ToString() + "/" + row["DD"].ToString() + "/" + row["CC"].ToString() + row["YY"].ToString().ToString()) ;

    The row["MM"].ToString is a String, but I'm finally parsing it into DateTime. And after execution I could see that the "ADMISSION_DATE" field type in DataSet changes to DateTime. So from this its clear that it's getting stored as DateTime and the field type is also DateTime. But the problem is to extract only the date thing, when I call the DataSet rows. Hope I dindn't confused you.

    C# help

  • Convert DateTime to Date
    V Verghese

    In my DataSet, I have a field called "ADMISSION_DATE" in the format of DateTime, which upon displaying in my Report showz up as, lets say, "08-29-08 12:00:00". 3rd Line displays the Date (08-30-08) as required but 4th line displays it as DateTime (08-29-08 12:00:00). But I want only the date thing (i.e. 08-29-08). And in dataset I don't see any direct DATE conversion methods. Please help.

    row["ADMISSION_DATE"] = DateTime.Parse(row["MM"].ToString() + "/" + row["DD"].ToString() + "/" + row["CC"].ToString() + row["YY"].ToString().ToString()) ;

    DateTime newDT = new DateTime(); //Line-1
    newDT = Convert.ToDateTime(row["ADMISSION_DATE"]).Date; //Line-2
    MessageBox.Show(newDT.ToShortDateString()); //Line-3

    row["ADM_DATE"] = newDT.ToShortDateString(); //Line-4

    Thanking you in anticipation.

    C# help

  • Crystal Report Title @ Run Time
    V Verghese

    I didn't meant to change the name of the report. I'm talking about the last section in the Crystal Report creation wizard which asks you to enter a title for the report and that title gets displayed every time you execute the report ( e.g Sales Summary Report - 2008 ). The top most title on the report page. To be more clear, I'm talking about the : PAGE HEADER (SECTION 2) of the Crystal Report. And I don't see any option to change the title name. Please comment.

    Database

  • Database column
    V Verghese

    My database table has got 5 fields and through my C#.Net code I'm adding the 6th field (using dataset and .WriteXmlSchema() )...........but it works fine for the first time............aftr tht since the DataSet schema has already been updated with the 6th column, it throws an error "6th Field already exists in database table"............ so i just want to do something like this :

    if (check whther Access Database Column is already present for the ABC Table) // if YES
    {
    do {nothing}
    }
    else
    {
    do {add the 6th column - for which i already have the code}
    }

    Database csharp database xml help

  • Crystal Report Title @ Run Time
    V Verghese

    Hello Friends, Please let me know if there's an easy to change the Report Title of Crystal Report at Runtime Coz I could see that once you create the Crystal Report there's no option to change the title else I have to start from the scratch creating a new Crystal Report and at that point of time adding the title what I want. Please share if you know something about this. Thanking you in anticipation.

    Database

  • Creating Reports using DataSet
    V Verghese

    Thank You Mika, I did it the other way round. After adding the new columns to the dataset. I have updated the dataset schema using .WriteXMLSchema (), this infact, updates the old schema with the one and shows the newsly added column in the fields explorer section of the Crystal Report. Dataset has been updated at its actual location:

    PDS.WriteXmlSchema(@"C:VS_Projects\PIN_DataSet.xsd");

    And also, I didn't add the new dataset, I have used the old one instead. Thanks again for all the help extended.

    Database csharp css database help tutorial

  • Display Newly Added DataSet Column
    V Verghese

    I have a dataset with 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. I have added a new column in Dataset which concatenates all these 4 fields and show it as a date field. Now I just want to know that how can I display these newly added DataSet column also in my Crystal Report alongwith the other fields. Thanking you in anticipation.

    C# database question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups