2003-07-18

Using ASP & SQL To Ping A Remote Server

Using ASP & SQL To Ping A Remote Server:
"USE MYDATABASE
GO
CREATE PROC sp_PingServer
@strServerIP VARCHAR(50)
AS
DECLARE @strCmd VARCHAR(60)
SELECT @strCmd = 'ping ' @strServerIP
EXEC Master..xp_cmdShell @strCmd
GO"

pretty cool!!

Google Search: tcpclient slow

Google Search: tcpclient slow: "When I use the winsock control and data_arrival events it
is very fast (less than 1 sec). When I use the TcpClient
Class .Connect, and networkstream.Send,
networkstream.Recieve, it is painfully slow (several
seconds). Mostly at connecting and receiving."


Today I experienced this same problem! I was at the end of my rope so I went to lunch with Rob and Paul today. When I got back I had an idea. I used the .Connect(IpEndPoint endpoint) ctr on TcpClient and it solved the speed problem.

My question is what's the difference between using IpEndPoint and just specifing the IpAddress (string) and Port (int)?

2003-07-17

Hack!

Somebody hacked up stronglytyped.com. heheheh....I'll have to get them back....HaHaHaHa (with a deep, spooky, evil sounding voice).

2003-07-15

RSS feed disabled

errrrr...my rss feed option in blogger has been disabled for about 2 weeks....how?

Getting the Most Out of the .NET Framework PropertyGrid Control

Getting the Most Out of the .NET Framework PropertyGrid Control

I started tinkering with the PropertyGrid control today. It sure makes it easy to build advanced edit UI's quickly. It has provisions for creating custom drop down boxes and such.

I got a little stuck when I introduced the DataSet object to the PropertyGrid Control. It displays *ALL* of the rows' public properties:



To mask the unwanted properties I created a DataRow facade:


public class HouseFacade
{
private HouseDataset.HouseRow _currentRow;

public void SetCurrentRow(HouseDataset.HouseRow row)
{
_currentRow = row;
}

[CategoryAttribute("Address"),
ReadOnlyAttribute(false),
Description("The street address")]
public string Address
{
get { return (_currentRow["Address"] as string ); }
set { _currentRow["Address"] = value; }
}

[CategoryAttribute("Address"),
ReadOnlyAttribute(false),
Description("name of the city")]
public string City
{
get { return(_currentRow["City"]); }
set { _currentRow["City"] = value; }
}


This gives me a bit more control, because now I can set the PropertyGrid related attributes (CategoryAttribute, Description, etc).



(The HouseFacade class is a great case for code generation.)

2003-07-14

Rob Fahrni, at the core

Rob Fahrni, at the core: "If it looks horrible in your browser please let me know and I'll try to correct it. "

Looks good from here!!

Exciting times...

"oh...I should announce: We are going to have a baby!!!"

Google Search: "could not find resource assembly" compact framework

Google Search: "could not find resource assembly" compact framework: "Hi,

By adding a reference to System.SR.dll in your VS .NET project, you should
get more valuable debugging information in your exception.

Hope this helps get to the root of your problem,

Craig

Program Manager,
NET Compact Framework Team"


Just found this out today. If you don't reference the System.SR.DLL you'll get the error "could not find resource assembly". Apparently the assembly contains the strings for more detailed error messages.

It was left out to conserve space. But it's only 91K + Error messages are a bit important, don't you think?

I found this in the Pocket PC SDK help file:

It’s Becoming a Managed World: "The problem with theological discussions of technical issues is that engineers tend to concentrate on their side of the argument without recognizing the valid issues contradicting their opinions. "

Yea...I think most of us validate this statement...including my self =(