Jump to content
Xtreme .Net Talk

Stijn

Members
  • Posts

    4
  • Joined

  • Last visited

About Stijn

  • Birthday 11/01/1981

Personal Information

  • Occupation
    programmer
  • Visual Studio .NET Version
    Visual Studio .NET Professional
  • .NET Preferred Language
    vb.net, c#

Stijn's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I wrote an application where the user needs an USB memory stick. When the user closes the program, some data is written to the stick. Can I write some code so my application is closing the usb stick whithout an action of the user? When I do not implement this, the user have to click on an icon in the taskbar for removing the usb stick safely. But i want to keep it simpel for the user ;) Does anyone knows some solution?
  2. :-\ My mistake, I forgot some brakets in the commandstring SELECT dbo.tblWinkel.AFK, dbo.tblImportCCD.CCDDatum, dbo.tblImportCCDDetail.CCDNaam, dbo.tblImportCCDDetail.CCDWaarde, dbo.tblImportCCDDetail.CCDQty FROM dbo.tblImportCCD INNER JOIN dbo.tblWinkel ON dbo.tblImportCCD.WinkelFK = dbo.tblWinkel.WinkelPK INNER JOIN dbo.tblImportCCDDetail ON dbo.tblImportCCD.ImportCCDPK = dbo.tblImportCCDDetail.ImportCCDFK WHERE (dbo.tblImportCCD.CCDDatum > CONVERT(DATETIME, '2004-02-20', 102)) AND (dbo.tblWinkel.AFK = N'AAL_DEN') AND ((dbo.tblImportCCDDetail.CCDNaam = 'Bon 1 EUR') OR (dbo.tblImportCCDDetail.CCDNaam = 'Bon 3 EUR') OR (dbo.tblImportCCDDetail.CCDNaam = 'Maaltijdcheque') OR (dbo.tblImportCCDDetail.CCDNaam = 'TicketRestaurant')) ORDER BY dbo.tblWinkel.AFK
  3. Thanks for your reply, but in the meantime I found a solution for my problem and it's working with the following command: dbCommand = New OleDbCommand("DELETE * FROM tblError WHERE (((tblError.ErrTime)<#" & Format(fourteenDaysBack, "yyyy-MM-dd) & "#))" I just had to format the date. But I do not understand why I have to do this. But I'm happy that it's working. But I have a problem with sql that looks the same. I have the following query SELECT dbo.tblWinkel.AFK, dbo.tblImportCCD.CCDDatum, dbo.tblImportCCDDetail.CCDNaam, dbo.tblImportCCDDetail.CCDWaarde, dbo.tblImportCCDDetail.CCDQty FROM dbo.tblImportCCD INNER JOIN dbo.tblWinkel ON dbo.tblImportCCD.WinkelFK = dbo.tblWinkel.WinkelPK INNER JOIN dbo.tblImportCCDDetail ON dbo.tblImportCCD.ImportCCDPK = dbo.tblImportCCDDetail.ImportCCDFK WHERE (dbo.tblImportCCD.CCDDatum > CONVERT(DATETIME, '2004-02-20', 102)) AND (dbo.tblWinkel.AFK = N'AAL_DEN') AND (dbo.tblImportCCDDetail.CCDNaam = 'Bon 1 EUR') OR (dbo.tblImportCCDDetail.CCDNaam = 'Bon 3 EUR') OR (dbo.tblImportCCDDetail.CCDNaam = 'Maaltijdcheque') OR (dbo.tblImportCCDDetail.CCDNaam = 'TicketRestaurant') ORDER BY dbo.tblWinkel.AFK But the problem is that I get alle the records back even the CCDDatum is less then 20/02/2004 and also all the other records where AFK isn't AAL_DEN. The data type of CCDDAtum is datetime with size 8 and the datatype of AFK is nvarchar(50) I really don't know what's going wrong because the selection of the CCDNaam is working. I only get the records with CCDNaam = 'Bon 1 EUR' or 'Bon 3 EUR' or 'Maaltijdcheque' or ' TicketRestaurant' Does anyone knows what's wrong?
  4. I have a problem with passing dates to my database. I have a table: tblError. And I want to delete some entries of this table at the beginning of my porgram. I'm taking a date fourteen days back from the current date. Dim currentDate As Date = DateTime.Now Dim fourteen As New TimeSpan(14, 0, 0, 0) Dim fourteenDaysBack As Date = currentDate.Subtract(veertienDagen) dbCommand = New OleDbCommand("DELETE * FROM tblError WHERE (((tblError.ErrTime)<#" & fourteenDaysBack.Date & "#))" ,dbConnectie) dbCommand.ExecuteNonQuery() When I'm running the program and I check the dates in the source code, they are in the format that I want: dd/MM/yyyy But when the dbCommand is executing the day and the month is switched. The wrong entries are removed from my access table. I checked the regional settings of my operating system but the are in the correct format. The entries are deleted correctly when I make an access delete querry with the same sql statement. I have the same problem when I want to select some entries in an other table between two dates, it isn't working. At this moment, I select all the entries in the table and check the date into my source code but my table will grow and it will work slower. Does anyone knows whats going wrong?
×
×
  • Create New...