|
Fetch the string value and using pares method as coded below you can convert string to date datatype
vb Code
Dim s As String = TextBox1.Text
Dim d As Date = Date.Parse(s)
Response.Write(d)
ganeshk
|
|
|
|
|
In ASP.NET using C# code i am able to send mail from only gmail mail id . But i am unable to send mail from other mail ids like yahoo,zapak . I used below code to send mail . analyze the code and help me to solve
<br />
<br />
using System;<br />
using System.Data;<br />
using System.Net;<br />
using System.Net.Mail;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.IO;<br />
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
protected void Send_Click(object sender, EventArgs e)<br />
{<br />
<br />
MailMessage me = new MailMessage(txt_from.Text, txt_to.Text, txt_subject.Text, txt_bodyMessage.Text);<br />
SmtpClient client = new SmtpClient(txt_mailServername.Text);<br />
client.Credentials = CredentialCache.DefaultNetworkCredentials;<br />
client.EnableSsl = true;<br />
client.Credentials = new NetworkCredential(txt_from.Text, txt_password.Text);<br />
client.Send(me);<br />
<br />
<br />
<br />
}<br />
<br />
}
ganeshk
|
|
|
|
|
This code does not send with an attachment.
If it works with one mail server and not another, then the issue is with your mail server settings, or the server itself.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
can you help me ,how to set email server for yahoo mail
ganeshk
|
|
|
|
|
No, I don't use yahoo. Can you set up a mail program to read yahoo mail ? I'd expect the settings to be the same.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
my coding working fine with gmail ids but it not so in the case of yahoo .When i am using yahoo mail id the below error i am getting
System.Net.Mail.SmtpException: The operation has timed out. at System.Net.Mail.SmtpClient.Send(MailMessage message)
ganeshk
|
|
|
|
|
Thanks for restating your problem. To restate the solution - if it works with gmail, then you either have the details wrong for yahoo, or they specifically do not support what you're doing.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to write webservice for invoke records from third party database and udate and modify to third party database using webservice.
Please help me any one have idea about this.
Raja
|
|
|
|
|
Hi, if I store text docs in a database as nvarchar or Text, must I set their content type when they are retrieved to be displayed? I have read tutorials on reading blobs and according to the tuts one must put data retrieved from the database in an array of type byte then set the content type. Does that only apply to binary data or does it apply to all data type? Thank you in advance for your help.
-- modified at 22:23 Monday 23rd July, 2007
|
|
|
|
|
The content type has nothing to do with your database, it has to do with telling the browser how to display what it's been sent, so it doesn't have to try and work it out for itself.
Have you considered buying a book on ASP.NET and working through it ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, there Christ, I am working through a book. I taught myself to develop static website and thought its time to go interactive so I started learning ASP.NET using VB.net from a book I've borrowed from the library. The problem I have is when I get stuck I have no one to ask. Often times I don't understand some of the explanations given or the explanations are not given for some of them at all. For some reason some of the code that was given in the book does not compile and so I'm here asking questions. Unfortunately I don't have money to take a formal class. Hope you understand where I'm coming from.
|
|
|
|
|
OK - sounds like perhaps you have an ASP.NET 1.0 or 1.1 book, and you're using 2.0, that's the most likely reason for compilation issues.
I know what it is to not have much money, but buying a single ASP.NET 2.0 book is not a huge investment, and it would help you a whole lot. By all means, keep asking questions here, but I do think a good reference would go a long way to getting you started with this stuff.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have form with the more number of text boxes and one button to save the data to database. When the user clicks on the button I have to save the data in database. Here my question is if the user clicks the button then I am saving the database after with in one second he by mistake clicks the button again then we need to ask him there is no changes in the form do you want to save it ? How do we check whther form data is changed or not?
Thanks
|
|
|
|
|
Heres an easy solution:
When the user clicks the "Save" button disable the button (this will prevent double clicks"
Keep the button disabled until something on the form changes, ie; some text changes.
To do the second part, he is some pseudo-code to help you get started
Dim HasChanged as Boolean = False
Then in the TextChanged Event of your textboxes (you can have one that controls all the textboxes so you dont have multiple functions doing the same thing) change HasChanged to True
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged,TextBox2.TextChanged, etc...
HasChanged = True
If HasChanged Then
Button1.Enabled = True
Else
Button1.Enabled = False
End If
End Sub
Keep in mind this is just a "general" starting point, you'll have to do the rest, then if you run into problems post your code here (and the problem/error you're having) and someone will help
"It's only that urgent if you have to pee."
Dave Kreskowiak
|
|
|
|
|
Psycho-*Coder*-Extreme wrote: It's only that urgent if you have to pee."
Dave Kreskowiak
That is a funny one. I put it in my CPHog sig the day he said that. I generally save some of these for the Soapbox
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi,
Instead of a R,D want to change the format to "R", "D". I have tried embedding some formatting like
string = """ & "R" & """ & "," & _
""" & "D" & """
Thanks for your time.
|
|
|
|
|
You don't need to create the quotes seperately, you can build it all as one string. This is language specific question that has nothing to do with ASP.NET, it looks like this is VB, which means I don't know exactly how to do it, in C# you use \"
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
To add to what Chrstian said:
string = """R"",""D"""
|
|
|
|
|
Another option worth a look at, would be to use string.format. It might not be especially usefull for two charectors, but works well with medium to larger strings.
VB
Dim s As String = String.Format("{0}{1}{0}, {0}{2}{0}", """", "R", "D")
C#
string s = string.Format("{0}{1}{0}, {0}{2}{0}", "\"", "R", "D");
This first argument is the format of the string (between first set of quotes), then just supply the parameters that you made place holders for (in the example 3).
*Edit (Added C# example - sorry I work with VB more than C#)
-- modified at 21:44 Monday 23rd July, 2007
|
|
|
|
|
I was going to do a String.Format example, I guess you beat me to it
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Used Chr(34) which seemed to work as well.
Thanks for all the help.
|
|
|
|
|
That'll work just fine, as well.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hello All,
Thank you for reading this post. Iam trying to build a single sign on, so that other applications in my company can be reached by just logging once. Here is how it is:
1. Lets say the site i build is called abc.com
2. I want the user to logon to abc.com, all my user info is in a SQL Server database
3.Once login is determined successful, we go to a welcome page in abc.com... From abc.com, there is a link called link1.abc.com which is a different application... here i dont want the application to ask for logon credentials again, it should give access to the user because user was validated in abc.com
4. Expanding this...how to I provide this service if i have more that 3 applications...???
My company cannot afford LDAP...all we have is a good SQL Server database, .NET 2005...what is the quickest and best way to acheive single sign on ???
Sample code, articles explaining things are very very welcome !!
Thank you
RH
|
|
|
|
|
If you have a single SQL Server database, then I'd imagine what you need is a database in there of who is logged on, which is shared between applications.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
my button click event is not being fired. Asp.net 2.0
why is that?
|
|
|
|