|
madhukk wrote: any sample code please..
One sample code for you.
String DateText="12/10/2009";
String [] DatePart= DateText.Split('/');
string dd=DatePart[0].ToString();
string mm=DatePart[1].ToString();
string yy=DatePart[2].ToString();
Hope you can take it forward. Let me know if any more issue.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I would prefer this one as it does not believe on string manipulatio and when we have datetime datatype then why do string manipulation?
String strDate = "12/27/2009";
String strFormat = "mm/dd/yyyy";
System.Globalization.CultureInfo provider = System.Globalization.CultureInfo.InvariantCulture;
DateTime dt = DateTime.ParseExact(strDate, strFormat, provider);
String dd = dt.Day.ToString();
String mm = dt.Month.ToString();
String yyyy = dt.Year.ToString();
|
|
|
|
|
Yes Nish, You are Correct. Actually there are many ways that we can implement it. I have given a very basic example. You given much better!
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
If everybody stored their datetime values properly as DateTime values and not as strings they would not get into this mess. Who is teaching all these awful habits?
|
|
|
|
|
Session["headline"] = dr["headline"];
Session["startdate"] = dr["startdate"];
Response.Redirect("newsedit.aspx");
next page
TextBox5.Text = Session["headline"].ToString();
String DateText = Session["startdate"].ToString();
String[] DatePart = DateText.Split('/');
string dd = DatePart[0].ToString();
string mm = DatePart[1].ToString();
string yy = DatePart[2].ToString();
DropDownList6.SelectedItem.Text=dd.ToString();
Object reference not set to an instance of an object.
|
|
|
|
|
madhukk wrote: Session["headline"] = dr["headline"];
Session["startdate"] = dr["startdate"];
Response.Redirect("newsedit.aspx");
next page
TextBox5.Text = Session["headline"].ToString();
String DateText = Session["startdate"].ToString();
String[] DatePart = DateText.Split('/');
string dd = DatePart[0].ToString();
string mm = DatePart[1].ToString();
string yy = DatePart[2].ToString();
DropDownList6.SelectedItem.Text=dd.ToString();
Object reference not set to an instance of an object.
What is ur question ?
madhukk wrote: DropDownList6.SelectedItem.Text=dd.ToString();
Object reference not set to an instance of an object.
I guess this one.
What is the value of dd.ToString(); ? Does this exist on the dropdownlist? Hope now you understand what I want to mean
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
SELECT DAY(startDate) as day, MONTH(startDate) as month, YEAR(startDate) AS Year FROM YourTable
|
|
|
|
|
J4amieC wrote: SELECT DAY(startDate) as day, MONTH(startDate) as month, YEAR(startDate) AS Year FROM YourTable
No, no, no! That's MUCH too sensible ...
|
|
|
|
|
Hi,
I need to display the content in my site of a particular link using RSS.
Eg:
When a user click the link of a new which is displayed using RSS, i need to display the content also in my page, without going to another site or source site. For yahoo RSS we get all links, When we click a link it will redirect to yahoo site for the content.
How can i bring the content in to my site without going to yahoo? How it possible? Is it possible?
Thankyou
YPKI
|
|
|
|
|
I have already provided you the information in your last thread. For details you need to search google. If need to read all the content of RSS nothing else.
Please read this article,
An ASP.NET RSS Feed Reader[^]
Let me know if it clear to you !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I try this article.. but the content is opening in www.megatokyo.com site. My requriment is to display the particular content in my site itself.. is it possible?
|
|
|
|
|
Yes. make a HTTPRequest for that site. Read the HTTPResponse. Parse the text and display it in your page.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
can u please provide me an example
|
|
|
|
|
hi Abhijit ,
Can u provide me a example
|
|
|
|
|
Hi All,
i have question, in my project most of user control is Register in page as traditional manner. If i change to load the user control dynamically, Is any performance difference will be there.
My question is, i need to improve performance of page.If i load the user control dynamically.any improvement of Performance?
Please suggest Me.
Thanks In Advance..
JohnDas
|
|
|
|
|
Yes you can dynamically load User control for Peformance improvement. Even I will suggest you look into Partial Page Caching which will improve your site peroformance a lot.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
I have one server application and one client application. Server application directly connected to the database. Client application uses web service.
I am using Cache in my client application. I am using Web Service fetching Records from Server application Storing into the cache. With the help of that cache I am performing some updation on the fetched data and update the cache.(Not updating database).
Now if client application stop or end by any condition(Failure of power supply). If I restart the application i will get the again the same data as well as newly added data from server application.
Now I want save previously updated data as well as newly added data into cache.
From Where Should I get the previous data if the power failure happens?.
Is there any other solution for that.
Thanks,
sjs
|
|
|
|
|
If I understand you correctly, the cache is memory only on the client, so if it is powered down its gone. If it is a true client app (NOT a web page) you could write the cache out to disk each time it changed (probably only the changed bits) and reload it at start up.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
|
You are welcome, hope its some help
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Anyone ahve any suggestions on what can be wrong when getting this error. I've installed my ASP.NET app on two machines .NET 2.0 and on one of the cpus this error occures.
Server Error in '/Distributor' Application.<br />
--------------------------------------------------------------------------------<br />
<br />
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)<br />
at FleetManagement.Services.SystemAdministrationServices.UserManager.GetUserRoles(String userName, String password)<br />
at FleetManagement.Services.SystemAdministrationServices.SystemAdministrationServices.GetUserRoles(String userName, String password)<br />
at FleetManagement.Services.AuthenticationServices.Authenticate.GetUserRoles(String userName, String password)<br />
--- End of inner exception stack trace --- <br />
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br />
<br />
Exception Details: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)<br />
at Scania.FleetManagement.Services.SystemAdministrationServices.UserManager.GetUserRoles(String userName, String password)<br />
at Scania.FleetManagement.Services.SystemAdministrationServices.SystemAdministrationServices.GetUserRoles(String userName, String password)<br />
at Scania.FleetManagement.Services.AuthenticationServices.Authenticate.GetUserRoles(String userName, String password)<br />
--- End of inner exception stack trace ---<br />
<br />
Source Error: <br />
<br />
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. <br />
<br />
Stack Trace: <br />
<br />
<br />
[SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)<br />
at Scania.FleetManagement.Services.SystemAdministrationServices.UserManager.GetUserRoles(String userName, String password)<br />
at Scania.FleetManagement.Services.SystemAdministrationServices.SystemAdministrationServices.GetUserRoles(String userName, String password)<br />
at Scania.FleetManagement.Services.AuthenticationServices.Authenticate.GetUserRoles(String userName, String password)<br />
--- End of inner exception stack trace ---]<br />
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431766<br />
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204<br />
Scania.Components.Authentication.AuthenticationServices.Authenticate.GetUserRoles(String userName, String password) +123<br />
Scania.Components.Authentication.AuthenticationHandler.GetRolesAsDelimitedString(String userName, String password, String delimiter) +101<br />
Scania.Components.Authentication.TicketManager.Get(String userName, String password) +106<br />
ScaniaDistributor.WebForm1.btnLogin_Click(Object sender, EventArgs e) +270<br />
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111<br />
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110<br />
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10<br />
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13<br />
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36<br />
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565<br />
<br />
<br />
<br />
<br />
--------------------------------------------------------------------------------<br />
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
_____________________________
...and justice for all
|
|
|
|
|
|
Hi to All,
I am planning to create a new web site in my free times. So that I can learn, in a productive way.
Now, since I am a beginner in ASP.NET (I have worked on VB.NET earlier)....I need certain help in starting up the project.
What I mean is, like certain points or tips or tricks or measures , we need to take care in initial point of doing any project....Please advice me those,if any, in ASP.NET projects...or point me out those places where I need to take care of it initially, so that later on I needn't to Re-Do everything, for any kind of change.
Example: say for scalability of the project, I need to beak my project in modules, so that any change can be updated easily....something like that...
Thanks in advance.
-----------------------------
I am a beginner
|
|
|
|
|
You'd do well to work out what parts of your page will appear on all pages, and put them in a master page. Then as you create parts of pages, you'd do well to consider controls that might appear on more than one page, and create them as user controls. You'd also do well to create your own base page class, which will give you access to things you commonly use. The first thing I add to such a base class, is access to a strongly typed version of the master page.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks a lot,
I am going to use vb.net code ....Please tell me any demerits of using vb.net code instead of C#?
thanks again
-----------------------------
I am a beginner
|
|
|
|