I have a gridview which I'm trying to get the display of phonenumbers listed in a certain display format; (xxx) xxx-xxxx.If I have the code such as this, it displays the unformatted phone number and (000) 000-0000 for the null items.
I'm writing a class to automatically extract information from an excel spreadsheet (using NPOI api) in C#, and then import this information into a database. I've got it all working fine except for one small issue.
One of the spreadsheets I'm working with, contains the date in the following format: 04/01/2011 04:43:28.
When I ran the web application, I got the following error message:
String was not recognised as a valid
So I debugged through the code after this, and it turns out that the date is being read in as:
40546.0151388889, so it is being formattted back to a number.
I am developing web application using csharp on visual studio 2008. I am loading the data from Microsoft Excel to datagrid. But when I want to check the date in a given column and getting the error String was not recognized as a valid DateTime . How can I solve this problem? The code I am using is below.
I'm using AJAX calendar control in a tabcontainer, The date is being captrued in the following format: "3/11/2010" (MM/DD/YYYY).And on code behind i'm converting the above value to datetime like this, Everytime i'm getting the error "String was not recognized as a valid datetime".Can anyone please help me out fixing this problem..
I created a simple Master Page in Visual Studio 2008:
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
and got green underlined 'Master' with two warning messages: 1.Validation (ASP.NET): This attribute name must be followed byan equal (=) sign and a value. If the value is in quotation marks, the quotation marks must match. 2. Validation (ASP.NET): Attribute 'Master' is not a valid attribute of element 'Control'.How I can get rid of the messages?
I am very new to ASP .NET and am getting above error when trying to insert a new record into a SQL database. I have turned on Option Explicit On so the default date of 01/01/1900 does not get assigned to this field automatically. Since most of the people in the database will not have a date of death, I need to have "blank" deathDate. When I run the stored procedure within SQL and choose pass null value, the Insert Procedure works fine. When I attach to Web Form, however, I get String was not recognized as a valid DateTime error. How can I set it so Null values are accepted into this date field.
This code works somewhat, but it won't place all of the text into the textbox.. If I change a few things I get an error where I highlighted the code in red. Conversion from string "" to type 'Double' is not valid. But the code works, like I said somewhat, as you see it, it just doesn't load all of the text to the text box.555632.txt
Code: Public Class Form1 Private Sub OpenFile_Click(sender As Object, e As EventArgs) Handles OpenFile.Click Dim IdxList As String Dim ProgArray() As String Dim Index() As String
I am trying to deploy my site from my computer to my server and I am getting the next error.
Server Error in '/Fleet' Application.
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately.
I have a SQL which is running good at SQL Server Mgm studio:
"select d.EmployeeID, CONVERT(VARCHAR(10),d.LogTime,111) as Date1, MIN(CONVERT(VARCHAR(8), d.LogTime, 108)) as FirstIn from LogTable d where d.dwStatus=0 group by d.EmployeeID, CONVERT(VARCHAR(10), d.LogTime,111)"
However, When i put it into my code (Entity SQL):
"select d.EmployeeID, CONVERT(VARCHAR(10),d.LogTime,111) as Date1, MIN(CONVERT(VARCHAR(8), d.LogTime, 108)) as FirstIn from IGPSiteEntities.AccessLogSet AS d where d.dwStatus=0 group by d.EmployeeID, CONVERT(VARCHAR(10), d.LogTime,111)"
I got error :
'CONVERT' cannot be resolved into a valid type of function. Near simple identifier, line1, column 200.
LogTime is a DateTime format e.g 05/05/2010 14:12:12
I want to select ONLY the Date (e.g 05/05/2010) and select ONLY the time (e.g 14:12:12) so i use CONVERT function.
I am having trouble formatting the date on a textbox I get the error above if I don't enter the date in MM/DD/YY format in the textbox. I am also using this in a FormView so I can't format it or don't know how to in the code behind so if there is a way to format it in design view that would be preferable. Does anyone have any ideas on how I would do any of this.
I am trying to insert a value in database from a dropdownlistddlvaue = 10.00 - 11.00in db asstarttime=10:00:00endtime=11:00:00using split function
string dropdownvalue = ddlduration.SelectedItem.Text.ToString(); string et = dropdownvalue.Split('-').ToString(); endtime = et.Split(' ').ToString(); starttime = dropdownvalue.Split(' ').ToString(); I am joining date value + time value in the query uisng('" + datevalue + "' + ' ' + '" + starttime + "')
'2014-05-15' + '16.00' --> to get 2014-05-15 16:00:00
it is getting inserted successfullybut while selecting and viewing it from the database I am getting error as,
"Arithmetic overflow error converting expression to data type datetime"
If i mannually enter the date in db it is workingmanuall value=2014-09-30 14:00query value =2014-09-30 14:00
both are same but error is only occuring for query inserted value
Error parsing attribute 'something': Type 'System.Web.Mvc.ViewPage' does not have a public property named 'something'.
Notice how it tries to use System.Web.Mvc.ViewPage rather than my BaseViewPage class. To make it more interesting, if I remove the "Something" attribute from the Page directive and put some code in the generic version of BaseViewPage (OnInit for example) the class is actually called / used / instantiated.
So, am I doing something wrong or is this a limitation.