How do you convert string from database into date in asp.net? -
Dim output = (From tlb In obj.SelectRecordAll_SalesInquiryRegister _
-
Join tlb1 In LatestPOs On tlb.SIR_OfferNo Equals tlb1.OfferNo _
-
And tlb.SIR_AlterationNo Equals tlb1.PORevNo _
-
Order By tlb.SIR_Flag _
-
Select _
-
SIRID = tlb.Marketing_SalesInquiryRegister_ID, _
-
poaltno = tlb.SIR_AlterationNo, _
-
OfferNo = tlb.SIR_OfferNo, _
-
PONo = tlb.SIR_Flag, _
-
poStatus = GetPOStatus(tlb.SIR_OfferNo, tlb.SIR_AlterationNo), _
-
Consignee = tlb.Marketing_Inquiry_Detail.Company_Master.Company_Name, _
-
ProductName = tlb.Marketing_Inquiry_Detail.QC_Product_Master.Product_Name, _
-
CreditPeriods = tlb.SIR_CreditPeriodDays, _
-
POAmount = Decimal.Round(tlb.Marketing_OfferPackingQuantity_Detail.Offer_Quantity * tlb.Marketing_OfferPrice_Detail.Offer_PricePerUnit, 2, MidpointRounding.AwayFromZero), _
-
Details1 = (From t In obj.SelectRecordAll_OfferDeliverySchedule _
-
Where t.DeliverySchedule_SIRID = tlb.Marketing_SalesInquiryRegister_ID _
-
Select SheduleDate = t.DeliverySchedule_Date, _
-
id = t.Marketing_OfferDeliverySchedule_Details_ID), _
-
Details4 = (From t In obj.SelectRecordAll_OfferDeliverySchedule _
-
Where t.DeliverySchedule_SIRID = tlb.Marketing_SalesInquiryRegister_ID _
-
Select SheduleQty = t.DeliverySchedule_Quantity, _
-
id = t.Marketing_OfferDeliverySchedule_Details_ID), _
-
Company = tlb.Marketing_Offer_Detail.Offer_CompanyID).ToList
-
-
-
lsvReport.DataSource = output
-
lsvReport.DataBind()
-
dim i as integer = 0
-
for each item in output
-
dim adddt =DateAdd("d", CType(output(i).CreditPeriods, Integer), DateTime.Parse(output(i).Details1(i).SheduleDate))
-
i=i+1
-
next
The error that I am getting is The string was not recognized as a valid DateTime
How to I solve this error?
how to convert string into date
3 2904
Have you tried CDate( string )
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Abhishek Srivastava |
last post by:
Hello All,
I wrote the following program.
using System;
using System.Globalization;
public class ShortDateTest
{
public static void Main(string args)
|
by: megala |
last post by:
Hi
How to convert a string "11022005" to a specific date format-02/11/2005
|
by: Raju5725 |
last post by:
Hi...
I am having string variable "BEGIN_DATE_TIME", in which there are three other variables each gives me ....month, date in on string and year in one string and time in another strings(Str2 & "-" & Str1 & " " & Str3)....i want to put them all together and i want to get a datetime. I tried with Cdate(BEGIN_DATE_TIME) but it is throwing an exception as
An unhandled exception of type 'System.InvalidCastException' occurred in...
|
by: l7alabeh |
last post by:
Hey,
I have a String and I want to convert it to a date in Visual Basic
(ASP.NET 2.0)
How can I do so??
|
by: Aobaidat79 |
last post by:
Dear Freinds
I have string contains the date like "21Jun2000"
What I want to do is to convert that string into date in the following format
21 Jun 2000
Plesae help me as soon as possible
'Thank you very much
| |
by: upriyaa |
last post by:
Hi
My requirement is to compare a date in string format with the Sysdate. The problem is the date string does not contain a zero before the single digit date and month.
Here is my query
select * from table_name where to_date(%date%, 'MM/DD/YYYY) > (SYSDATE - 7);
this gives an error saying the month is not valid when the month in %date% is single digit.
Please help
|
by: nady |
last post by:
Hi,
I have a database in mysql i have column which is text and i need to convert it to date for query purposes.
the format for the string in the column is dd/mm/yyyy i need to convert this to date.
please help
|
by: satiss7pwr |
last post by:
I have a string date like this:
"3/28/2008 12:05:45 pm"
i want to convert it into date and display the out put
any one can help me plssssssssss
|
by: Shivareddy |
last post by:
i have date in string in this format
eg. 1/20/21011 i need to convert it into the date object
|
by: dsatino |
last post by:
I'm getting a tab delimited file that I need to import into an access DB. The date field comes over as an 8 character string in the yyyymmdd format.
Does anyone know an easy way to convert this to a date or a pre-existing function?
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |