This blog is for all Microsoft & .net lovers who may find themselves in need of help or information once in a while. We all have questions and we all need to know more than we know right now. When I come across things that I think may be useful, I post it. When I have something to say that I think is important, which is everything, I post it. All of my C#, ASP.NET, VB, AJAX & programming friends around the world are welcome to the info in my blog - Ramblings Of A Crazy DotNet Woman!
Friday, July 30, 2010
Fix For Client-Error-Not-Possible Brother HL 2140 Problem On A Mac
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
Friday, July 18, 2008
Problem: Button In Datalist Has To Be Clicked Twice To Run
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
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! :-(
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
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
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
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!
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)