|
Check before you call Application object placed in the variable:
if (Application.AllKeys.Contains<string>("userCount"))
{
Application.Lock();
int item = Convert.ToInt32(Application["userCount"]);
Application["userCount"] = item + 1;
Application.UnLock();
}
else
{
Application.Set("userCount", 1);
}
|
|
|
|
|
Abhishek Sur wrote: if (Application.AllKeys.Contains("userCount"))
thanx Abhishek..it really works!!!
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Hi,
I am using the following code in my Web application for checking whether the image at the remote server exist or not. This works perfectly on my local machine, but when I upload this code on my Live website, it returns no response( response = null)
private static bool IsImageExists(string imageURL)
{
bool fileExist;
HttpWebResponse response = null;
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(imageURL);
request.Method = "HEAD";
request.Credentials = System.Net.CredentialCache.DefaultCredentials;
using (response = (HttpWebResponse)request.GetResponse())
{
if (response.StatusCode == HttpStatusCode.OK)
{
// If no exception was thrown until now, the file exists and we are allowed to read it.
fileExist = true;
}
else
{
// Some other HTTP response - probably not good.
// Check its StatusCode and handle it.
fileExist = false;
}
}
}
catch
{
fileExist = false;
}
return fileExist;
}
Is this threading related issue. Please give me quick solution.
Thanks in Advance.
d'kng
|
|
|
|
|
Not getting any error? Looks like your server may be using proxy. Try setting the proxy details to the request object.
|
|
|
|
|
Thanks Navneet,
I am updating the code with this additional lines to set proxy.
WebProxy browserProxy = new WebProxy();
// Obtain the Proxy Prperty of the Default browser.
browserProxy = (WebProxy)request.Proxy;
request.Proxy = browserProxy;
I'll update you once it is done.
D'kng
|
|
|
|
|
Hey Guys need help
I created a DataSet with the query that i need. However i will like to display the DataSet Detail to the crystal Report
DataSet ds = DBCall.ReturnDataSet(SQL , DBCall.ITSDatabase);
CrystalReportViewer1.DisplayGroupTree = false;
CrystalReportViewer1.HasCrystalLogo = false;
ReportDocument myReportDocument;
myReportDocument = new ReportDocument();
myReportDocument.Load(Server.MapPath("CrystalReport2.rpt"));
myReportDocument.SetDataSource(ds);
CrystalReportViewer1.ReportSource = myReportDocument;
CrystalReportViewer1.DataBind();
However i can't seem to display it one the report. I know this is the Push Method however
I need to set the layout of the report right? How am i suppose to set it ?
Many thanks
KaKaShi HaTaKe
|
|
|
|
|
Hi
I'm trying to play audio on my webpage directly from the databse, can anyone help me with the code for my method: playAudio(byte[] stream), please see my code bellow.
thanks n advance
<pre>string sql = @"Select AudioFile from tbDeviceResults where DialResultID = @ID";<br />
SqlConnection oCon = new SqlConnection(DatabaseConnection.ConnectionString);<br />
SqlCommand cmd = new SqlCommand(sql, oCon);<br />
cmd.CommandType = CommandType.Text;<br />
cmd.Parameters.AddWithValue("@ID", ID);<br />
DataTable tblData = new DataTable();<br />
try<br />
{<br />
new SqlDataAdapter(cmd).Fill(tblData);<br />
foreach (DataRow row in tblData.Rows)<br />
{<br />
stream = (byte[])row["AudioFile"];<br />
playAudio(stream);<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
<br />
<br />
}<br />
void playAudio(byte[] stream)<br />
{<br />
<br />
}<br />
<br />
</pre>
|
|
|
|
|
DotNetCoderJunior wrote: can anyone help me with the code for my method: playAudio(byte[] stream),
You will need to make an ASP.NET page which reads the content as you arealy did and set the appropriate MIME type using ContentType
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi all,
following code is using to send mail.
Problem is,it is reaching only our company domain mail ids not others.like gmail,yahoo etc which is wrong.
what i have to do to send any mail id from any my gmail or company mail id.
please can anybody give me some solution.pleaseee
Dim objmail
objmail = New MailMessage
With objmail
.To = "abcd@ourcomanydomain.in"
.From = "abc@yahoo.co.in"
.Cc = "abc@ourcompanydomain.in"
.Subject = "My Message"
.Body = "HTML Messag"
.BodyFormat = MailFormat.Html
End With
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(objmail)
kissy
|
|
|
|
|
Once you have sent any mail at all, then you are able to send mail. Any mail that gets lost, is probably getting caught in a spam filter.
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 for ur replay.when i can send to my company domain,then how the spam can filter other mails.
i am not getting,can u please give me some explanation with some example so that i can apply in my code?/
unsent msgs are queued up in queue folder of inetpub
please
kissy
|
|
|
|
|
This is probably an SMTP relaying issue which goes beyond the scope of ASP.Net
Talk to your network administrator and tell him that your server needs to be permitted to relay messages.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Kissy16 wrote: following code is using to send mail.
Problem is,it is reaching only our company domain mail ids not others.like gmail,yahoo etc which is wrong.
The code is ok and you can do nothing in your code to allow this.
You should check your smtp server whether it actually sends the mail outside your company domain or not?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thanks for ur reply.
how to check this?what i have to at smtp end?
coz i hae keep it on hosting server.accordign that can u give me some idea???
please
kissy
|
|
|
|
|
Talk to your network admin. If mail is only running to your internal address, then the mail server needs to be configured to allow outside mail. Or you should use a different server
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.
|
|
|
|
|
8.
class a
{
public virtual void a()
{
cwl ("Base");
}
}
class b : a
public overrides void a()
{
cwl ("Dericed");
}
}
b obj=new b();
b.a();
what is the outpu?
9. Difference between Private constructor and Sington class?
10. What are Generics? Example on that?
11. Difference between SP and UDF?
12. Can we call UDF from .NET like Stored Procedure?
13. Difference between public and protected Internal?
14. what are all the methods of System.Object?
15. Difference between Finalize() and Dispose?
16. Destructor?
|
|
|
|
|
I don't need to answer these, because I have a job. However, if I needed to, I could. If I were interviewing someone, I might ask some of these questions, but I'd also ask for real world examples, so I could seperate the programmers from the people who practiced questions on the web, but had no idea how to write good code.
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.
|
|
|
|
|
Someone may give you answer of all these questions, but even thn it is not gonna help you.
Did you even try once google to find answer of any of these? That excerise would have instead given you more information and also some confidence
I would suggest you to find the answers yourself and not expecting the READYMADE food.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Man,
you'll get a lot more info if you try Google.Also the answer of these questions you can get any basic c# book.
Cheers!!
Brij
|
|
|
|
|
hello........i made a website and after launching when i run it.....it gives me this error....can anybody tell me whts reason behind this error...plz guide me. The Error is:
Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
|
|
|
|
|
Is this site hosted on IIS Server ? Did you set the Framework Version?
|
|
|
|
|
I am Using Helm Server and Framework Version is set to 2.0
|
|
|
|
|
The error means EXACTLY what it says.
1 - you have an error
2 - you need to make the changes it is telling you to make, in order to see what the actual error is
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.
|
|
|
|
|
Frnds,
I have got 200 varibles, that i want to insert in database.
Im confused, how to do that..
HELP!!!!
|
|
|
|
|
Contact your client, tell them you are stealing from them. Seriously, if you are confused at this basic a level, you should choose more simple tasks and work through them until you have enough experience to take on tasks like this.
You insert them with SQL, there's really no other way. You can use transactions, if you want to make it all or nothing, apart from that, that's all there is.
this also has NOTHING to do with ASP.NET.
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.
|
|
|
|