Showing posts with label insertion. Show all posts
Showing posts with label insertion. Show all posts

Wednesday, March 21, 2012

Date of insertion

Hello Techies
Is there way to find out the date when the record was added or modified in a
table.
We are using Sql Server 2000. Any suggestion other than the usage of
date/time stamp field is highly appreciated.
Awaiting your valuable inputs.
IT Consultant
MCAD .NET
Microsoft TechnologiesSQL Server doesn't store that information under the covers (all who don't ne
ed the information would
pay the cost). You can use a log reader tool (see my links page for list of
some) to find the
corresponding log record assuming it is still in the transaction log.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Clement Edwin" <clementedwin@.hotmail.com> wrote in message
news:CA1420E0-BBC5-4308-BE9B-011A88A7A2F1@.microsoft.com...
> Hello Techies
> Is there way to find out the date when the record was added or modified in
a
> table.
> We are using Sql Server 2000. Any suggestion other than the usage of
> date/time stamp field is highly appreciated.
> Awaiting your valuable inputs.
> --
> IT Consultant
> MCAD .NET
> Microsoft Technologies

Date of insertion

Hello Techies
Is there way to find out the date when the record was added or modified in a
table.
We are using Sql Server 2000. Any suggestion other than the usage of
date/time stamp field is highly appreciated.
Awaiting your valuable inputs.
--
IT Consultant
MCAD .NET
Microsoft TechnologiesSQL Server doesn't store that information under the covers (all who don't need the information would
pay the cost). You can use a log reader tool (see my links page for list of some) to find the
corresponding log record assuming it is still in the transaction log.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Clement Edwin" <clementedwin@.hotmail.com> wrote in message
news:CA1420E0-BBC5-4308-BE9B-011A88A7A2F1@.microsoft.com...
> Hello Techies
> Is there way to find out the date when the record was added or modified in a
> table.
> We are using Sql Server 2000. Any suggestion other than the usage of
> date/time stamp field is highly appreciated.
> Awaiting your valuable inputs.
> --
> IT Consultant
> MCAD .NET
> Microsoft Technologies

Monday, March 19, 2012

Date Insertion problem

I am using BLL for inserting my data. I have some date filed and I have declare that field in BLL as date only. But still it is giving me error string in wrong format. My database is in SQL Server2005

can u give me a code, how you are declared date in BLL and how you are assining the values to that date variable in BLL, it may be your date variable string is not in proper format.

|||

================================Codes in BLL =============================================================================

<System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert,True)> _

PublicFunction AddTempEmployee(ByVal DDKSFileNoAsString,ByVal firstNameAsString,ByVal middleNameAsString,ByVal lastNameAsString, _

ByVal dateOfBirthAsDate,ByVal maritualStatusAsInteger,ByVal nationalityAsString,ByVal passportNumberAsString, _

ByVal passportIssuePlaceAsString,ByVal passportIssueDateAsDate,ByVal passportExpiryDateAsDate,ByVal civilIDNumberAsString, _

ByVal civilIDExpiryDateAsDate,ByVal residenceNumberAsString,ByVal homePhoneNumberAsString, _

ByVal alternatePhoneNumberAsString,ByVal kuwaitHomeAddressAsString)AsBoolean

Dim tempEmployeesAsNew DDKS.TempEmployeeDataTableDim tempEmployeeAs DDKS.TempEmployeeRow = tempEmployees.NewTempEmployeeRow

tempEmployee.DDKSFileNo = DDKSFileNo

tempEmployee.FirstName = firstName

tempEmployee.MiddleName = middleName

tempEmployee.LastName = lastName

tempEmployee.DateOfBirth = dateOfBirth

tempEmployee.MaritualStatus = maritualStatus

tempEmployee.Nationality = nationality

tempEmployee.PassportNumber = passportNumber

tempEmployee.PassportIssueDate = passportIssueDate

tempEmployee.PassportExpiryDate = passportExpiryDate

tempEmployee.CivilIDNumber = civilIDNumber

tempEmployee.CivilIDExpiryDate = civilIDExpiryDate

tempEmployee.ResidenceNumber = residenceNumber

tempEmployee.HomePhoneNumber = homePhoneNumber

tempEmployee.AlternatePhoneNumber = alternatePhoneNumber

tempEmployee.KuwaitHomeAddress = kuwaitHomeAddress

tempEmployees.AddTempEmployeeRow(tempEmployee)

Dim rowAffectedAsInteger = Adapter.Update(tempEmployees)

Return 1

EndFunction

========================================= Ends here ===============================================================================

===============================Codes in aspx file==========================================================================================================

<tdstyle="width:150px; height: 27px;"><cc1:MaskedTextBoxID="txDateOfBirth"runat="server"Text='<%# Bind("DateOfBirth", "{0:d}") %>'Mask="99-99-9999"ReadOnly="True"></cc1:MaskedTextBox>

=====================================ends here=====================================================================================================

|||

chk whether you are passing correct values to correct varibale,,

this is not a solution, but sometime we do small mistakes,

chk whether ur passing string to string variables, date to date varibles and integer to integer, and also chk the ur datatypes of the columns for those fields.

DDKsFileNo String
Firstname String
MiddleName String
LastName String
DateofBirth Date
MaritualStatus Integer (I think this is Boolen or bit)
nationality String
PassportNumber String
PassportIssuePlace String
PassportIssueDate Date
PassportExpiryDate Date
CivilIDnumber string
CivilIDExpiryDate Date
residenceNumber String
HomePhoneNumber String
alternatePhoneNumber string
kuwaitHomeAddress string

|||

chk whether you are passing correct values to correct varibale,,

this is not a solution, but sometime we do small mistakes,

chk whether ur passing string to string variables, date to date varibles and integer to integer, and also chk the ur datatypes of the columns for those fields.

DDKsFileNo String
Firstname String
MiddleName String
LastName String
DateofBirth Date
MaritualStatus Integer
nationality String
PassportNumber String
PassportIssuePlace String
PassportIssueDate Date
PassportExpiryDate Date
CivilIDnumber string
CivilIDExpiryDate Date
residenceNumber String
HomePhoneNumber String
alternatePhoneNumber string
kuwaitHomeAddress string

|||

chk whether you are passing correct values to correct varibale,,

this is not a solution, but sometime we do small mistakes,

chk whether ur passing string to string variables, date to date varibles and integer to integer, and also chk the ur datatypes of the columns for those fields.

DDKsFileNo String
Firstname String
MiddleName String
LastName String
DateofBirth Date
MaritualStatus Integer
nationality String
PassportNumber String
PassportIssuePlace String
PassportIssueDate Date
PassportExpiryDate Date
CivilIDnumber string
CivilIDExpiryDate Date
residenceNumber String
HomePhoneNumber String
alternatePhoneNumber string
kuwaitHomeAddress string

|||

My problem got caught it something like i was using "-" as seprator in application and my regional setting was using "/" so i change same in my application and start working.

Thanx for help