
joe_pool_is
Avatar/Signature-
Posts
512 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by joe_pool_is
-
We've used Inno Setup 5 from time to time, but it does not use the Windows Installer to check for compatibility very well (i.e. it will not make sure the correct version of the .NET Framework is installed). The Inno Setup team is aware of this condition, but does not intend to rewrite their application to target Windows anytime soon. Does WiX address dependencies like these?
-
That is some interesting stuff, and a lot to read! Seems like Microsoft would allow a default certificate saying something like, "Issued to Visual Studio developer Bobba Fett" (or whoever the software was licensed under) with a link in the application of where to go to instantly purchase a custom certificate through Microsoft. I'm surprised Micro$oft hasn't exploited this path to more money. Thanks for the link!
-
How do I get or create a trusted Certificate for the ClickOnce setting to sign my project? I'm using Visual Studio 2005, and it allows me to create a temporary test certificate. I don't see how to change it so that it reads something besides my domain and login name, and I don't see how to make it a trusted certificate by placing it "in the Trusted Root Certification Authorities store." - even though I clicked "Select from Store..." Where can I find information on how to do this?
-
I'm building a Setup and Deployment project in Visual Studio 2005. I need to place two (2) check boxes on the setup screen that allow me to place an icon on the desktop and another that launches the application after setup completes. 1. I don't know how to modify these forms that VS2005 gives me. 2. I don't know where to write code that modifies or reacts to any of the conditions from a check box. Where can I go for answers? C#, VB - it doesn't matter.
-
SQL Summary Report w/ 2 tables
joe_pool_is replied to joe_pool_is's topic in Database / XML / Reporting
Just an FYI Update: This query problem has been solved. The query I used is below. If anyone sees anything that is particularly time consuming in this technique or something that could be improved upon, I invite your comments. declare @WO nchar(10) set @WO='463202' select distinct(Serial_Number) into #wo from Parts_Data where ([WorkOrder_Number]=@WO) select Left(ct.Serial_Number, CharIndex(' ', ct.Serial_Number) - 1) as 'Model', (select distinct WO_Qty from Parts_Data where [email="WO=@WO"]WO=@WO[/email]) as 'Ordered', (select distinct WO_Qty from Parts_Data where [email="WO=@WO"]WO=@WO[/email]) - Count(distinct ct.WO_Seq) as 'Remaining', (select Count(Serial_Number) from Parts_Data where System_ID like '%Admin%' and Serial_Number in (Select Serial_Number from #wo)) as 'Admin', (select Count(distinct Serial_Number) from Vendor_Data where System_ID like '%Riviting%' and Serial_Number in (Select Serial_Number from #wo)) as 'Riviting', (select Count(distinct Serial_Number) from Vendor_Data where System_ID like '%Welding%' and Serial_Number in (Select Serial_Number from #wo)) as 'Welding', (select Count(Serial_Number) from Parts_Data where System_ID like '%Assembly%' and Serial_Number in (Select Serial_Number from #wo)) as 'Assembly' from Parts_Data ct where (Len(RTrim(ct.Serial_Number))=15) and ([email="ct.WO=@WO"]ct.WO=@WO[/email]) group by left(ct.Serial_Number, CharIndex(' ', ct.Serial_Number) - 1) drop table #wo -
I've got 2 tables I need to search and provide a Work Order Summary on. The tables both have similar information: One is populated by a machine that is purchased through a vendor. One is popluated by our software and is designed to mirror the format of the vendor's table.Vendor's Table Design: Serial_Number|System_ID |Test_Result varchar(20) |varchar(50)|varchar(255) A Serial_Number consists of a tracking number tacked on to a Part_Number (i.e. Part_Number 'ABC' could have Serial_Number 'ABC 001' to 'ABC 999'). A System_ID is the name of the station where the operation happens (Admin, Machine_Stamp, Riviting, Welding, PressureTank, Assembly, etc.). A Test_Result would indicate if the part passed or failed a particular station (There are about 15 other fields to indicate the machine operators, dates, pressures/temperatures used, etc; but they are not part of the Summary). Our Table Design (used for Admin and Assembly System_IDs): Serial_Number|System_ID |Test_Result |Work_Order|WO_Qty|WO_Seq varchar(20) |varchar(50)|varchar(255)|char(10) |int |int Work_Order is the work order number, WO_Qty represents the number of items that are in the work order, and WO_Seq represents each item in the work order. So, for a work order with 3 items, the WO_Seq would be 1, 2, and 3. I am attempting to write a Summary given a particular Work_Order number. The desired output by Management is as follows: |_Model_|_Ordered_|_Remaining_|__Admin__|_Machine_Stamp_|_Riviting_|_Welding_|_PressureTank_|_Assembly_| | ABC | 25 | 0 | 50 | 50 | 50 | 50 | 50 | 50 | | ADA | 50 | 15 | 35 | 29 | 28 | 17 | 9 | 7 | Given a Work_Order, I need to Count the values of Test_Result that include the word 'pass' for each System_ID (i.e. Count(Test_Result like '%pass%') where System_ID=SysID), but I don't know how to do this for two tables, multiple System_IDs, a given Work_Order field that only appears in our table, and have the output display on a single line. Would someone mind showing me how to do something like this? Is it possible? My other option is to query all the information in one table using the Work_Order, store this in a DataTable, query the other table for each of the Serial_Numbers returned from the first query, then write a routine to filter it all. But this brute force method seems wasteful, and I'd like to know how to build better SQL queries.
-
Microsoft SQL Server Desktop Engine (MSDE)
joe_pool_is replied to samsmithnz's topic in Database / XML / Reporting
The last post here was done by Derek Stone in 2004 (4 years ago). SQL CE is out now, and is supposed to be the successor to MSDE, from what I hear. Does anyone have good information on SQL CE? Particularly, I'm looking how to include it in my installers so that the applications I distribute can use it (My customers typically are not intelligent enough to install SQL themselves). -
Modifying File Attributes
joe_pool_is replied to joe_pool_is's topic in Directory / File IO / Registry
Re: Not unsetting ReadOnly or Hidden! That actually helps a lot. Thanks for taking the time to write the bits out, Mr. Paul! I hope it comes in handy for others, too. -
I'm to a place where I need to modify a file's attributes so that I can encrypt or decrypt the file because Hidden or ReadOnly files fail. I've written a basic static method (so my threads can call it), and I wanted to post it here for criticism or suggestions: static bool FileExists(string file) { if (File.Exists(file) == true) { FileInfo fi = new FileInfo(file); if ((fi.Attributes & FileAttributes.Directory) == FileAttributes.Directory) { return false; } if ((fi.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) { fi.Attributes &= FileAttributes.ReadOnly; // & removes, | adds // or, toggle the ReadOnly portion only (use one or the other, but not both) // fi.Attributes ^= FileAttributes.ReadOnly; } if ((fi.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden){ fi.Attributes &= FileAttributes.Hidden; } return true; } else { return false; } }
-
Thanks Nate! I'll "chunk" it, then! Any preference on how much data at a time is best? The snippet above uses 1024 bytes, but that's just a computer number.
-
What are the Pros and Cons with performing a stream operation in chunks as opposed to performing that same operation on the full file? "In Chunks" Example: void ReadFileInChunks(string file) { using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read)) { int len; byte[] buffer = new byte[1024]; do { len = fs.Read(buffer, 0, 1024); Console.WriteLine("Read 1024 bytes of data."); } while (0 < len); fs.Close(); } }"Full File" Example: void ReadFileAtOnce(string file) { using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read)) { byte[] buffer = new byte[fs.Length]; if (fs.Read(buffer, 0, buffer.Length) == buffer.Length) { Console.WriteLine("Finished!"); } fs.Close(); } }I just want to make sure I use a technique that will give me the greatest results while not putting my code into a dangerous situation. I'm guessing the ReadFileAtOnce method works fine as long as there is enough RAM to read the entire file. Passing ReadFileAtOnce a 6GB ZIP file backup of a DVD would likely cause the method to fail. Any other thoughts on the subject?
-
If someone wants to use Print Screen, that's their business. They can screenshot all 600 pages of his book, and I'm not even going to try to block it. ;) I was thinking about converting the PDFs to a series of images; there are tools I can download to convert all of the files in a batch. That might be a good idea.
-
We have a client that wants us to create a custom viewer for an electronic document that he is selling for hundreds of dollars. His document is in PDF format, which can be embedded in a project as a resource and displayed at runtime. However, the only way I can see to display it is to reference the Adobe Reader. If I do that, Adobe's interface gives everyone the ability to save the file or print the file. We need to cripple this system so that these documents can be viewed only, and they have to be viewed in our interface. Is there some way to do this? If we have to get away from PDF, what is another format that we could use?
-
I hate to keep bothering you about this, but I've run into a related question: Given a file (could be an image, a zipped archive, a text file, PDF, etc), how could my application tell if the file has already been encrypted with my technique? I want to retain whatever extensions are already on the original file formats whenever they are encrypted and replace the original file with the encrypted version - unless they are already encrypted! If they are already encrypted, I want to decrypt them. I just don't know how to test for a file or a stream already being encrypted.
-
Wow! A nice, new tutorial in the Code Library! Thank you, PD!
-
I need a way to encrypt and then decrypt a stream of bytes. There are many techniques that I've found on how to encrypt a file, but decrypting the information so that it can be used again seems to be a secret. Has anyone run across something that shows how to encrypt then decrypt a file?
-
The PrintPreviewDialog that comes with VS2005 is good, but the people using our software are having a hard time learning how to call the PageSetupDialog first. They are accustomed to Microsoft Word's ability to simply drag a bar around to set the margins and such from within the Print Preview. Does anyone know of a way to either include a PageSetupDialog within the PrintPreviewDialog or know of how to write a custom PrintPreviewDialog to include PageSettings?
-
One Connection String for Multiple Users
joe_pool_is replied to joe_pool_is's topic in Database / XML / Reporting
Oh man - I just found it! In the project properties, I had enabled SQL Server debugging, but the global User ID/Password did not have authorization to do this! Solution: Uncheck "Enable SQL Server debugging" or set Integrated Security to SSPI (True). I wanted to post the results. I hope someone that needs help is able to pull this post one day. -
One Connection String for Multiple Users
joe_pool_is replied to joe_pool_is's topic in Database / XML / Reporting
Hi Nate, Turned out that the Integrated Security overrides the User ID/Password settings if it is enabled. (If it is False, then User ID/Password are used). So, I got this fixed, and now our restricted users have access to the data. The only problem is that our regular (power) uses no longer have access. The message I get whenever I attempt to run from my machine is: "EXECUTE permission denied on object 'sp_sdidebug', database 'master', owner 'dbo'." The first line of the StackTrace says: " at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)" The restricted users do not see this. Any ideas? -
We have one connection string to our SQL Server 2000: "Data Source=WORKAPP;Initial Catalog=Parts_Data;Integrated Security=SSPI;User ID=public;Password=public"; Everyone can connect to the database in our plant except for the Restricted Users. Why can't the Restricted Users access this? How can we get around it? I can access the data, but I am set up as an Administrator. Our managers can access the data, but they are set up as Power Users. Most machines are Windows XP, but some use Citrix Servers and a few are running Windows Vista. The OS does not seem to make any difference. We do not want to grand Power User status to everyone, and we should not need to with the correct connection string.
-
Well, that sucks! I also read in your links that these Required Field Validators aren't being supported by other browsers. I think I'll do a search on JavaScript validators and just ditch the MS version.
-
What's wrong with my validators? They used to work, and I certainly don't remember changing anything. Am I using an outdated design? <table><tbody> <tr> <td>Name:</td> <td> <asp:TextBox ID="txtFirst" runat="Server" /> <asp:RequiredFieldValidator ID="validFirst" runat="server" ErrorMessage="Required" ControlToValidate="txtFirst"> Required</asp:RequiredFieldValidator> </td> </tr> <tr> <td>E-Mail:</td> <td> <asp:TextBox ID="txtEmail" runat="server" /> <asp:RegularExpressionValidator ID="vaildEmail" runat="server" ErrorMessage="Invalid" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"> Required</asp:RegularExpressionValidator> </td> </tr> <tr> <td colspan="2" align="center">Message:<br /> <asp:TextBox ID="txtMessage" Columns="40" Rows="10" runat=server Text="Write your message here." TextMode="MultiLine" /> <br /> <asp:RequiredFieldValidator ID="validMessage" runat="server" ErrorMessage="Required" ControlToValidate="txtMessage"> Required</asp:RequiredFieldValidator> </td> </tr> <tr> <td colspan="2" align="center"> <asp:Button ID="btnSubmit" runat="Server" Text="Send" OnClick="btnSubmit_Click" /> <br /> </tr> </tbody></table>
-
Resource Files in Application
joe_pool_is replied to joe_pool_is's topic in Directory / File IO / Registry
Those "cs" tags need some work. They jacked up my code so that it just about isn't readable. I think I'll stick with the basic "code" tag for now. Nate: Is there some way to verify that a file has not been altered? If one of these files is opened in the application that made them (LabelView), small changes could cause the labels to print incorrectly - generally, this means that fields won't show up. I'm worried that copying these files out there every time is going to cause a lot of fragmentation on that drive over time. -
Resource Files in Application
joe_pool_is replied to joe_pool_is's topic in Directory / File IO / Registry
Ok, here is what I am doing: byte[][] data = new byte[][] { global::Responder.Properties.Resources.BoxLabel_lbl, global::Responder.Properties.Resources.BoxLabel_lvd, global::Responder.Properties.Resources.BoxLabel_prv }; string[] sResFile = new string[] { "BoxLabel_lbl", "BoxLabel_lvd", "BoxLabel_prv" }; for (int i = 0; i < sResFile.Length; i++) { string[] part = sResFile[i].Split(new char[] { '_' }); string strFile = string.Format("{0}\\BoxLabel.{1}", Application.CommonAppDataPath, part[1]); using (FileStream fs = new FileStream(strFile, FileMode.Create)) { fs.Write(data[i], 0, data[i].Length); fs.Close(); } } m_objLvDoc = new LabelDocument(); if (m_objLvDoc.Open(Application.CommonAppDataPath + "[url="file://\\BoxLabel.lbl"]\\BoxLabel.lbl[/url]", true) == 0) { OpenFileDialog ofd = new OpenFileDialog(); ofd.FileName = Application.CommonAppDataPath + "[url="file://\\BoxLabel.lbl"]\\BoxLabel.lbl[/url]"; ofd.DefaultExt = "lbl"; ofd.InitialDirectory = Application.CommonAppDataPath; if (File.Exists(ofd.FileName) == false) { if (ofd.ShowDialog() != DialogResult.OK) return; } if (m_objLvDoc.Open(ofd.FileName, true) == 0) { string msg = string.Format("Unable to open LabelView form.\r\n{0}", m_objLvDoc.LastError); MessageBox.Show(msg, "LabelView - Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error, 0); Close(); return; } }If anyone sees bad logic in my code, please let me know. If no one sees bad logic, the code above will be there for others to reference. (I should have posted this in the "Directory / File IO / Registry" section. Could a moderator please relocate this?) -
Resource Files in Application
joe_pool_is replied to joe_pool_is's topic in Directory / File IO / Registry
Hey Plausibly, I already have the file(s) in my project's resources, but I can't seem to find a clean way of reading the files out of the resource's byte stream. I've got a control that I need to pass the file's path to, so I need to get the byte stream to a physical location on the PC so that it can be accessed. I don't work with streams very often, so I'm not sure of the best way to do this and the examples I find online don't really address this approach.