Showing posts with label replies. Show all posts
Showing posts with label replies. Show all posts

Monday, March 26, 2012

Suggestion for App

I am trying to do a web page with a network status on it for several apps. I have tried it one way and posted it here but no replies. Any suggestions on how to have it ping a server with many different servers with online if it gets a reply or offline if it gets the time out or cant ping. Any helpe would be appreciated.

Thanks

To simply ping a server it is as simple asMy.Computer.Network.Ping("hostnameOrIp")

It will return true or false.


Cool. What I am trying to do is take that information and put in a page that says Online or Offline. But I have several Servers to do this. Any suggestions? Thanks for replying by the way.

Well, do one ping per server :P The way ping works is that it tries to send small packets to the destinated IP, if the data gets through we have PING! (funny word btw ;-). Things will get a bit different if you want to check if the server answers on specific ports. But just to do ping on several servers is piece of cake:

If My.Computer.Network.Ping("server1") = true
response.write("Online")
else
response.write("Offline")
end if

If My.Computer.Network.Ping("server2") = true
response.write("Online")
else
response.write("Offline")
end if


I would setup an ArrayList to hold all the servers, then loop through them, ping, and print their status:

Dim arrServersAs New ArrayList()Dim intCountAs IntegerDim strMessageAs StringarrServers.Add("192.168.1.100")arrServers.Add("192.168.1.101")arrServers.Add("192.168.1.102")For intCount = 0To arrServers.Count - 1 strMessage ="Server " &CStr(arrServers(intCount))If My.Computer.Network.Ping(arrServers(intCount))Then strMessage +=" is online"Else strMessage +=" is offline"End If Response.Write(strMessage)Next
 
Hope this helps! Please do not forget to mark the helpful post(s) as Answer so future readers know what solved your problem.

MY is requiring declaration and where is it to be declared?

IfMy.Computer.Network.Ping(arrServers(intCount))Then


Are you using ASP 1.x or 2.0?
2.0

Well that is really strange, becuase My works just fine and I have tested it.

It should be an automatically inherited namespace. I guess the only thing I can suggest you to try it to put

Imports My

at the top of the code behind.

Also, are you using C#?


Heck no. I can't stand anything to do with C. LOL I am using VB.

It works to an extent. I have about 14 servers I do this and I want to be able to do:

XXX Online or XXX Offline

YYY Online or YY Offline

Right now it is accounting all of the being online becasue it is going to the first one.


Thanks,


I got it to work. I had to alter some of the code. I got rid of the arrays and the loop. I did use the rest of your coding. I appreciate your help.
Glad you got it working! Please mark the most helpful post(s) asAnswer for the sake of future readers. Thank you.

Thursday, March 22, 2012

Support Trouble ticket type deal

I'm trying to make a support ticket system, I would like to know

How would you display how many replies an issue hasthe date of the last replyThanks

What is your DB architecture like?

I would have 2 tables:
(1) Tickets which contains all ticket information such as title, issue, member who submitted the ticket, createDate, and TicketID.
(2) TicketReplies which contains all replies for a ticket, a createDate, and a foreign key TicketID.
You can set createDate default binding = getDate() which will return the current dateTime.

If you need to know how many replies there are for a ticket you can run:
SELECT COUNT(*)
FROM TicketReplies tr
JOIN Tickets t
ON tr.TicketID = t.TicketID
WHERE t.TicketID = (whatever the ticket is that you are interested in)

If you need to know the date of the last reply you can run:
SELECT *
FROM TicketReplies tr
JOIN Tickets t
ON tr.TicketID = t.TicketID
WHERE t.TicketID = (whatever the ticket is that you are interested in)
ORDER BY CreateDate DESC

Tuesday, March 13, 2012

Survey Sample (hopefully this copy of my previous post will allow replies!)

Hi

I downloaded the Survey Sample and Survey Admin Sample from MSDN's Code Centre two years ago and have been using it regularly since with Windows 2000 Server, IIS 5.0 and the .NET Framework 1.0. However, I am unable to port the Survey solution to a new production Web server, running Windows Server 2003, IIS 6.0 and the .NET Framework 1.1, due to a error when setting the Nested property of a DataRelation to true in the AdjustQuestionPrimaryKey() sub-routine ("A column named 'Answer' already belongs to this DataTable: cannot set a nested table name to the same name"). There are a few reports of a similar issue elsewhere on the Web but I have yet to find any that refer to a satisfactory resolution. Given that the Survey and Survey Admin samples appear to have disappeared relatively recently from MSDN, I was wondering whether anyone can offer an explanation for this occurrence or, alternatively (and preferably!), has a solution to the problem. I should add that I have yet to apply service pack 1 for the .NET Framework 1.1 but did not notice any documented connection between the issues that it addresses and the difficulty I have reported.

Regards

GazHi Gaz,

Yeah, I had it removed as too many people were having problems with it, and I didn't have the time to go through the code and fix all of the migration issues. There was one fix I did that may work for you, however. In the response.xsd file, change the definition of Answer from:

<xs:element name="Answer" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="Id" form="unqualified" type="xs:int" />
<xs:attribute name="Text" form="unqualified" type="xs:string" />
</xs:complexType>
</xs:element
to a complex type with a different name. Actually, here's the whole file:
<?xml version="1.0" ?>
<xs:schema id="NewDataSet" targetNamespace="http://tempuri.org/SampleResponse.xsd"
xmlns:mstns="http://tempuri.org/SampleResponse.xsd"
xmlns="http://tempuri.org/SampleResponse.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="unqualified" elementFormDefault="unqualified">
<xs:complexType name="AnswerType">
<xs:attribute name="Id" form="unqualified" type="xs:int" />
<xs:attribute name="Text" form="unqualified" type="xs:string" />
</xs:complexType>
<xs:element name="SurveyResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Question" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Answer" minOccurs="0" maxOccurs="unbounded" type="AnswerType" />
</xs:sequence>
<xs:attribute name="Id" form="unqualified" type="xs:int" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Id" form="unqualified" type="xs:string" />
</xs:complexType>
<xs:key name="SurveyResponseQuestionKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Question" />
<xs:field xpath="@.Id" />
</xs:key>
<xs:key name="SurveyResponseAnswerKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Answer" />
<xs:field xpath="@.Id" />
</xs:key>
<xs:key name="SurveyResponseKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//Question" />
<xs:field xpath="@.Id" />
</xs:key>
<xs:key name="SurveyResponseKey2" msdata:PrimaryKey="true">
<xs:selector xpath=".//Answer" />
<xs:field xpath="@.Id" />
</xs:key>
</xs:element>
<xs:element name="BaseResponseDataSet" msdata:IsDataSet="true" msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="SurveyResponse" />
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema
Alternately, you might want to look at nSurvey, which is a full featured survey application.