Friday, July 30, 2010

Fix For Client-Error-Not-Possible Brother HL 2140 Problem On A Mac

OK. I know what you are thinking - this is a .Net Crazy blog - not a Mac/Apple blog. I admit that you are right, but (AND THIS IS A BIG BUT) I have just spent more time than I care to admit (OK - about an hour really) trying to get my handy dandy Brother HL-2140 to print after hooking it up to my iMac. Yes I know.....I'm a PC girl, but I do have many computers running various things and I do have a Mac in the family. Everyone is welcome where I come from!

Anyway, I have been using this printer with my PCs without a problem. I hooked it up to my iMac, download the latest drivers for it from the Brother website and tried to print. Nothing! What? Isn't hooking a printer up to the mac supposed to be super easy (hahaha)? Nope! I uninstalled and reinstalled (the PC thing to do) and still nothing. I kept getting a client-error-not-possible error! What in the world is that? Talk about obscure errors! Ghhheeshhhhh! I researched the issue. Many people have had the same issue, but there was no resolution displayed. OK. Lets start playing around.

I decided to try to see if it was the printer driver causing the problem or the printer. I selected a variety of different types of print drivers to see if I could get the printer to have a reaction. I used various CUPS drivers for different Brother printers since that is what the actual driver for the HL-2140 is. I came up short! Then I used a Gutenprint driver for one of the other Brother printers. Guess what? I got a reaction! The printer "pretended" to print - it spit out paper, but didn't print the text. OOOOKKKKK.....now what?

Since I did get a reaction when I used a Gutenprint driver, I realized that the issue was driver related (see how smart I am?). I decided to try a different approach. I went back to the Brother website and I downloaded an OLD driver for the HL-2140. I have an iMac with OS 10.5.8 (as of today) and I downloaded the HL-2140 driver for OS 10.4. I went through the process of installing - blah,blah,blah - followed directions - blah,blah,blah and tried to print. Guess what? It worked!!!! Success, success, success! I AM as smart as I think I am (I hope :-)).

Anyway, that solved the problem and I could print on my Brother HL-2140 using my iMac running OS 10.5.8. Hopefully this saves you time and allows you to just get on with things.

If this helps you, write a comment and tell me how wonderful I am. If it DOESN'T help you, write a comment and tell me know how wonderful I am.

Smooches,

Kila

Problem: Brother HL 2140 printer will not print when connected to an iMac running OS 10.5.8

Solution: Download the old drivers for OS 10.4 from the Brother website and install it per the instructions. After the install and reboot, the printer should now print using the old drivers.

Tuesday, November 10, 2009

Windows Firewall On Windows 7 Is Little Snitch For The PC

Mac users have a little program they can use to prevent their computers from sending outbound messages to other computers. The program, affectionately called Little Snitch, can be purchased for a small fee. For that small fee, you get the ability to be notified whenever a program tries to send an outbound connection and you get the ability to stop that outbound call. Well PC users using Windows 7 - and possibly other versions of Windows - have a similar ability via Windows Firewall.

Windows Firewall ships with Windows 7 and while it does not notify you every single time a program tries to establish an outbound connection, it does give you the ability to block any and all outbound calls by any program on your system. You may be asking yourself why you would want to block outgoing calls from your PC to another PC. Well there are a few reasons. First, the naughty reason. If you are a person who uses pirated software, you may find that your software gets disabled whenever you have your LAN or Wireless Internet up and running on your computer. Often, applications call back to their creators for validation. This means that while you may install that wonderfully pirated version of some Adobe software on your PC, as soon as the software runs and calls back to Adobe it can be disabled. While I'm not advocating software piracy, I also don't advocate my PC doing things I didn't tell it to do like make outbound calls. Windows Firewall takes care of that. Windows Firewall makes it easy to block any outgoing call to any computer. Now it isn't as nice as Little Snitch because it doesn't notify you directly when a program tries to call out, however, it does offer you the ability to log the calls so that you can see which programs tried to make a connection and it does offer you the ability to block those calls beforehand.

The second reason for blocking outbound connections from your PC may not be as obvious as the first. If your computer is ever infected by a virus which causes it to make outbound calls, you can stop those messages from going out using Windows Firewall. Of course you would first need to realize that your computer is sending out messages, but that is another post. Windows Firewall manages your inbound connections to, so you can stop certain computers or certain companies from automatically doing things on your computer. For instance, if you often visit Adobe's website, you may find that Adobe automatically tries to communicate with your computer. Windows Firewall can automatically block these types of inbound connections for you.

Are you ready to discover how to block incoming connections on your PC and how to block outgoing connections on your PC? Good!

Step 1:
Go to your control panel. You can usually achieve this by clicking on the Start button and selecting Control Panel.

Step 2:
Once in the Control Panel, you might need to go to small icon view in Windows 7. For some reason, Microsoft loves to change the interface of the Control Panel area when they update Windows. This time they removed the ability to just see things in the old Detail view. I don't know why they feel the need to do this, but I really wish they would stop. I am not an icon person. I need clear words that outline everything in a particular area. That initial view had me sitting around looking at the Control Panel wondering where everything was. Microsoft, I love you dearly, but if you don't stop grouping things in ways that long time users can't understand, I'm going to have to sue you or something (I will probably take the or something route - but don't tell them that!). Anyway, switch the view using the little arrow in the upper right hand corner to small icon view and select Windows Firewall. You will need to be an administrator on your machine to alter the outbound connections.

After opening Windows Firewall, you now have the ability to alter your incoming and outgoing connections, log your connections or stop all connections (NOT recommended). 

Smooches,

Kila

Friday, July 18, 2008

Problem: Button In Datalist Has To Be Clicked Twice To Run

OK. For the past couple of days I have been working on a website for a client. I added an Update Panel to the page along with a datalist control with many buttons inside of it. Most of the buttons worked perfectly on the first click. However, I had a few stubborn buttons that were making me click on them twice before they would fire the ItemCommand event of the datalist. Just so you know, I bubble the events of all the buttons up to the ItemCommand event of the datalist using the CommandName and CommandArgument properties of the buttons.

In this case, these were all set correctly. So why did I still have to click twice on the button to make the ItemCommand event execute? I tried everything to figure out the answer. I switched events. I put the code into the Command event of the button - still had to click twice. I grabbed the index of the selected item from e.Item.ItemIndex in the ItemCommand event and did a rebinding of the datalist control in that event and then set the index back to the selected index - still had to click the button twice. I changed the type of button from a regular button to a link button - still had to click the button twice. I changed where I was binding the controls. Initially, I was checking if the page was a postback. If it wasn't a postback, I did a bind to set the datalist up. I removed the IsPostBack and just started binding all the time to see if that would help - still had to click those darn buttons twice!!!! I put the code in every event of the button and datalist control - still had to click the button twice. I was baffled beyond baffled. You know what? It's funny how we can walk away from something, go get something to eat, go get some rest and then come back and figure out the answer that was sitting right in front of us all along.

After not being able to get the button in the datalist to fire on the first click and trying everything but the right thing to fix it, I just started thinking through the logic. OK. So the user initially clicks on a button to select the item - this button uses the ItemCommand event of the datalist yet it works on the first click. OK.... Then, the user selects a radio button that I extended with a CommandName and CommandArgument property so I could control the events from it with ItemCommand too. The radio button works perfectly on the first click. Now, this button that the radio button enables after being clicked wants to be clicked twice.....why......why.....why??!?!?!?!?! Then it hit me like a ton of bricks. What was controlling the datalist control? AN UPDATE PANEL!!!!!! I had the UpdatePanel Trigger set to AsyncPostBack for the datalist control and the ItemCommand event. I changed the UpdatePanel trigger from AsyncPostBack to just PostBack on the datalist control and guess what boys and girls??????????????????????????????????? I didn't have to click my buttons twice anymore!!!! The button updates now work exactly as they were meant to without requiring an extra click! All is right with the world. Well, maybe not, but at least all is right with the buttons on my datalist control. They now respond to the single click they were meant to respond to. Happy Friday to me!!

Problem:
Buttons on a Datalist control required two clicks instead of one
(in case you are searching for the answer to button in datalist clicked twice, two clicks on button in datalist control, button in datalist not firing ItemCommand event)

Solution:
Change your UpdatePanel trigger on the datalist control to PostBack from AsyncPostBack. Your buttons should now the ItemCommand event when they are clicked once.

Note: This may not be the solution in all cases. If you aren't using an update panel, I would suggest making sure that you check where you are your datalist control. After removing the Updatepanel and testing this issue through, I noted that changing when I bind the datalist would also correct the issue.
Smooches!

Monday, June 23, 2008

System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

Don't you just love messages like that when you are programming!! I sure as hell do! Whats not to love about an obscure message that has nothing to do with the problem you are experiencing? Recently, after adding a column to a stored procedure I created, my application started giving me this wonderfully helpful error message. First, I went to my stored procedure to see what was coming back from the database. Everything was coming back just fine. Then, I went to my dataset in Visual Studio and....everything looked fine!! Darn!!! Wasn't everything just working a minute before I added that line to my stored proc???

I went back to my dataset in Visual Studio and looked through it once more. The answer to this stupid error message came jumping out at me. I had changed the stored proc in SQL Server and then right clicked on the table adapter in the dataset and selected Configure to add the column. You have to use Configure in order to get the dataset to recognize the column you just added to the stored proc. The column was added perfectly, except there was ONE little detail that was wrong - the max length of the column had defaulted to 10. Changing this stopped the error!!!!

Here is a screenshot of the item that must be changed to stop this stupid error.





I love you Microsoft, but darn! Can't you give me accurate messages when there is something wrong? Something that says that I violated a primary key constraint is a lot different from needing to change the MaxLength of a column.....or at least I think it's different :-) (ha,ha...don't send me a message! I'm being sarcastic here!)

I don't know...maybe I'm just stupid!! :-)


Problem:

You add a new column to a stored proc or sql statement and when the data is pulled using the fill method of a strongly typed dataset you get an error message about a constraint issue.

Error Message:
System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

Solution:
Change the MaxLength value of the column you just added.





Wednesday, December 12, 2007

PureBlogic Has Been Taking Up My Time! :-(

Ok. I'm so guilty. I should be ashamed of myself. I haven't been posting any updates on this blog. I know I've been bad, but, I have a real good excuse. I've been working on a new project. It's called PureBlogic and you can check it out at PureBlogic.com. So what is PureBlogic all about? I'm so glad you asked. PureBlogic is a blog about making money blogging and having fun while doing it.

I've been working on this for some time. It has been a big deal for me for a couple of reasons. First, I taught myself PHP to support this project. Before you even say it, I know. I know. I'm dot net crazy right? So what am I doing cheating with PHP? Well there are a number of reasons. I really wanted to use Wordpress for this blog because of it's superior support and because of all the fantastic plug-ins that are available for the platform. I wish I could have that kind of platform in .NET. I started thinking about creating a platform written in C#.NET that would be as great as Wordpress. I wanted to leverage my .NET knowledge. Then common sense got into me and I decided to just spend a little time teaching myself PHP. Second, I got to use MySQL. I love MySQL. I'm SQL Server certified and all, but MySQL is free for everyone. I think that opensource projects tend to become great because everyone works to make them the best they can be. MySQL has a lot of support everywhere. SQL Server is my database of choice, but I enjoyed being able to use my MySQL knowledge.

I'm not PHP crazy, but, I have to admit that it is pretty simple. There are a lot of positives to the language. Am I going to switch to the DARK SIDE? Nope. Well..... not until I start developing Wordpress themes :-). At that point, I am going to be one with the DARK SIDE. Sometimes the DARK SIDE pays the bills. I also did something else that I didn't plan on doing - using the Linux OS. I've truly gone over the edge !!!! But don't worry. I'm still dot net crazy and I'm still on the right team.

Sometimes you just have to learn what you need to learn to get done what you need to get done!

Check out my blog at www.PureBlogic.com when you have a chance and let me know what you think. Don't concentrate on the design. Its in flux right now while I create exactly what I want.Due to fact that I needed to put posts on the blog before I could qualify for certain programs, I had to put it up even without the exact look on it that I wanted. It will change real soon. In the interim, I'll be back!

Wednesday, November 21, 2007

Getting Information From input Tags On A Page In .NET Using Request.Form.AllKeys & Request.Form.Get

While creating a web-based software program recently I came across a small problem. This program dynamically creates a number of textboxes inside of rows that reside inside of a table server control. The rows along with the cells & textboxes are all dynamically created based on user input. Once the textboxes have been created, the user is able to enter information into them. Then the software has to read that information and process it.

This sounds like a simple process right? Well it is a simple process, however, I ran into one problem. When you dynamically create text boxes they are rendered as input tags in the html and not as .net server controls with this tag . This creates an issue when you need to loop through the controls and get the information from the textboxes.

Now you may be thinking, what is she talking about? I can just loop through the Table’s row collection and get a reference to the textbox controls that way. Well I’m here to tell you that won’t work. Sorry L. You may be thinking that you can get to the textboxes via the form’s control collection. Well I’m here to tell you that won’t work either. So what’s a girl, or a guy, to do? Well ladies and gentleman, the answer is really simple.

All you have to do is use Request.Form.AllKeys and Request.Form.Get and you will be able to get a reference to those pesky controls all day long. Here is code you can use. In my case, I named those textboxes with a generic name and just incremented the numbers. So if a user requested 120 boxes, my textbox names would range from uTxt1 to uTxt120. That way I could loop through and use StartsWith(“uTxt”). Here is my code:

//variables
int i = 0;
string sValue = "";

foreach (string s in Request.Form.AllKeys)
{
//this lets me know that I have reached one of the controls that
//I dynamically created earlier
if (s.StartsWith("uTxt"))
{
sValue = Request.Form.Get(i);
this.ProcessRows(sValue);
}

i++;
}

That’s it! Now you can reference any of the controls at any time without any issues.
By the way, if you are using placeholder controls , Request.Form.AllKeys and Request.Form.Get really come in handy since placeholders render the asp server controls used for input as input controls and not server controls.

Smooches,

Kila

Summary
Server controls are being rendered as html input controls in the final page and you need to access the values of these controls in the code-behind at runtime.

Error/Problem:
You can't get a reference by looping the control collections of the aspx page because all of the values return null and the controls values you need are being held by html controls and not server controls.

Solution:
Use Request.Form.AllKeys in combination with Request.Form.Get to get to the particular control and value you need. You can loop through the AllKeys collection using a foreach loop and then reference the item you need using Get.

Tuesday, November 20, 2007

Where Is IsNumeric In C#? Right Where It Should Be!

When I first switched from programming in Visual Basic to programming in C#, I felt a little neglected. There were a few basic functions that were not available to me in C# that were available in VB. One of these wonderful functions is IsNumeric. We all know that we can’t trust end users to enter the correct thing in our wonderful textboxes on our forms. Therefore, we have to check. In VB it was as simple as calling IsNumeric and popping in whatever I wanted to check. In C#, I had to write more than the 9 letters of IsNumeric to do the same thing. If you are a newbie to C# and you have experience in VB, I’m sure you have looked around for that function in vain.

There were some happy smiles around the Internet when C# programmers thought that it was coming in the next version of dot NET. Oh well. You can wipe those happy smiles off of your faces. As you may or may not know, it just ain’t happenin’ folks! (Please don’t email me to correct my English. I say what I want. I’m a woman) So since it’s not already in C#, and it’s not coming to C#, what are we going to do? There are so many solutions floating around the Internet that I’m sure you can find one quickly, however, I say if you can’t beat’em join’em.

Here is where References come in handy. It’s not really earth shattering, but I’m sure that someone somewhere may find it useful. So put away your RegEx stuff and stop writing your own class and let dot NET do all of the work for you. I’m so lazy right?

At the top of your code-behind in your using section, add a reference to Microsoft.VisualBasic. It should look like this:

using Microsoft.VisualBasic;

Now in your code, you can reference IsNumeric like this:

bool bYourVariable = true;

//cast the variable to string to avoid an error if it really is a string
//the error you get if you don’t cast it first is that the string
//isn’t formatted properly
string whateverYouAreCheckingGoesHere.ToString();

bYourVariable = Information.IsNumeric(whateverYouAreCheckingGoesHere);

That’s it! Now you can laugh in the faces of our VB programming brothers and sisters all around the world and tell them that you have found the IsNumeric in C#. You have put the eggs back in the cake and you can bake! Tell them that C# rocks. Then go back to doing whatever it was that you were doing!

Smooches,
Kila

Summary
Using the IsNumeric function in C#

Error/Problem:
C# does not have a built in IsNumeric function

Solution:
Create a reference to Microsoft.VisualBasic and then use Information.IsNumeric(whateverYouAreCheckingGoesHere)