Daily Archives

Articles indexed Tuesday February 8 2011

Page 8/13 | < Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Does SQL Server Compact not support keywords 'Foreign Key References' in Create Table or am I making a mistake?

    - by johnmortal
    I keep getting errors using Sql Compact. I have seen that it is possible to create table constraints in compact edition as shown here. And according to the documents found here it provides "Full referential integrity with cascading deletes and updates". So am I really not allowed to do the following or am I making a mistake? I keep getting complaints from sql server compact edition that the constaint is not valid, though it works fine on express edition. CREATE TABLE [A] (AKey int NOT NULL PRIMARY KEY); CREATE TABLE [B] (AKey int NOT NULL FOREIGN KEY REFERENCES A(AKey));

    Read the article

  • Sorting string column containing numbers in SQL?

    - by Ish
    Dear Folks, I am trying to sort string column (containing numbers). // SELECT `name` FROM `mytable` ORDER BY `name` ASC +----------+ +-- name --+ +----------+ +-- a 1 ---+ +-- a 12 --+ +-- a 2 ---+ +-- a 3 ---+ You see natural sorting algorithm of Mysql is placing a 12 after a 1 (which is ok for most apps), But I have unique needs, so I want result should be sorted like this. +----------+ +-- name --+ +----------+ +-- a 1 ---+ +-- a 2 ---+ +-- a 3 ---+ +-- a 12 --+ Is it possible with just SQL, or I have to manipulate result-set at application level? Thanks for reading...

    Read the article

  • mysql whats wrong with this query?

    - by Hailwood
    I'm trying to write a query that selects from four tables campaignSentParent csp campaignSentEmail cse campaignSentFax csf campaignSentSms css Each of the cse, csf, and css tables are linked to the csp table by csp.id = (cse/csf/css).parentId The csp table has a column called campaignId, What I want to do is end up with rows that look like: | id | dateSent | emailsSent | faxsSent | smssSent | | 1 | 2011-02-04 | 139 | 129 | 140 | But instead I end up with a row that looks like: | 1 | 2011-02-03 | 2510340 | 2510340 | 2510340 | Here is the query I am trying SELECT csp.id id, csp.dateSent dateSent, COUNT(cse.parentId) emailsSent, COUNT(csf.parentId) faxsSent, COUNT(css.parentId) smsSent FROM campaignSentParent csp, campaignSentEmail cse, campaignSentFax csf, campaignSentSms css WHERE csp.campaignId = 1 AND csf.parentId = csp.id AND cse.parentId = csp.id AND css.parentId = csp.id; Adding GROUP BY did not help, so I am posting the create statements. csp CREATE TABLE `campaignsentparent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campaignId` int(11) NOT NULL, `dateSent` datetime NOT NULL, `account` int(11) NOT NULL, `status` varchar(15) NOT NULL DEFAULT 'Creating', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 cse/csf (same structure, different names) CREATE TABLE `campaignsentemail` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parentId` int(11) NOT NULL, `contactId` int(11) NOT NULL, `content` text, `subject` text, `status` varchar(15) DEFAULT 'Pending', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=140 DEFAULT CHARSET=latin1 css CREATE TABLE `campaignsentsms` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parentId` int(11) NOT NULL, `contactId` int(11) NOT NULL, `content` text, `status` varchar(15) DEFAULT 'Pending', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=141 DEFAULT CHARSET=latin1

    Read the article

  • Binding ListBox ItemCount to IvalueConverter

    - by Ben
    Hi All, I am fairly new to WPF so forgive me if I am missing something obvious. I'm having a problem where I have a collection of AggregatedLabels and I am trying to bind the ItemCount of each AggregatedLabel to the FontSize in my DataTemplate so that if the ItemCount of an AggregatedLabel is large then a larger fontSize will be displayed in my listBox etc. The part that I am struggling with is the binding to the ValueConverter. Can anyone assist? Many thanks! XAML Snippet <DataTemplate x:Key="TagsTemplate"> <WrapPanel> <TextBlock Text="{Binding Name, Mode=Default}" TextWrapping="Wrap" FontSize="{Binding ItemCount, Converter={StaticResource CountToFontSizeConverter}, Mode=Default}" Foreground="#FF0D0AF7"/> </WrapPanel> </DataTemplate> <ListBox x:Name="tagsList" ItemsSource="{Binding AggregatedLabels, Mode=Default}" ItemTemplate="{StaticResource TagsTemplate}" Style="{StaticResource tagsStyle}" Margin="200,10,16.171,11.88" /> AggregatedLabel Collection using (DB2DataReader dr = command.ExecuteReader()) { while (dr.Read()) { AggregatedLabelModel aggLabel = new AggregatedLabelModel(); aggLabel.ID = Convert.ToInt32(dr["LABEL_ID"]); aggLabel.Name = dr["LABEL_NAME"].ToString(); LabelData.Add(aggLabel); } } Converter public class CountToFontSizeConverter : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { const int minFontSize = 6; const int maxFontSize = 38; const int increment = 3; int count = (int)value; if ((minFontSize + count + increment) < maxFontSize) { return minFontSize + count + increment; } return maxFontSize; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion } AggregatedLabel Class public class AggregatedLabelModel { public int ID { get; set; } public string Name { get; set; } } CollectionView ListCollectionView labelsView = new ListCollectionView(LabelData); labelsView.GroupDescriptions.Add(new PropertyGroupDescription("Name"));

    Read the article

  • Conditions with common logic: question of style, readability, efficiency, ...

    - by cdonner
    I have conditional logic that requires pre-processing that is common to each of the conditions (instantiating objects, database lookups etc). I can think of 3 possible ways to do this, but each has a flaw: Option 1 if A prepare processing do A logic else if B prepare processing do B logic else if C prepare processing do C logic // else do nothing end The flaw with option 1 is that the expensive code is redundant. Option 2 prepare processing // not necessary unless A, B, or C if A do A logic else if B do B logic else if C do C logic // else do nothing end The flaw with option 2 is that the expensive code runs even when neither A, B or C is true Option 3 if (A, B, or C) prepare processing end if A do A logic else if B do B logic else if C do C logic end The flaw with option 3 is that the conditions for A, B, C are being evaluated twice. The evaluation is also costly. Now that I think about it, there is a variant of option 3 that I call option 4: Option 4 if (A, B, or C) prepare processing if A set D else if B set E else if C set F end end if D do A logic else if E do B logic else if F do C logic end While this does address the costly evaluations of A, B, and C, it makes the whole thing more ugly and I don't like it. How would you rank the options, and are there any others that I am not seeing?

    Read the article

  • Help with linq to sql compiled query

    - by stackoverflowuser
    Hi I am trying to use compiled query for one of my linq to sql queries. This query contains 5 to 6 joins. I was able to create the compiled query but the issue I am facing is my query needs to check if the key is within a collection of keys passed as input. But compiled queries do not allow passing of collection (since collection can have varying number of items hence not allowed). For instance input to the function is a collection of keys. Say: List<Guid> InputKeys List<SomeClass> output = null; var compiledQuery = CompiledQueries.Compile<DataContext, IQueryable<SomeClass>>( (context) => from a in context.GetTable<A>() where InputKeys.Contains(a.Key) select a); using(var dataContext = new DataContext()) { output = compiledQuery(dataContext).ToList(); } return output; Is there any work around or better way to do the above?

    Read the article

  • Sorting Multidimensional Array with Javascript: Integers

    - by tkm256
    I have a 2D array called "results." Each "row" array in results contains both string and integer values. I'm using this script to sort the array by any "column" on an onclick event: function sort_array(results, column, direction) { var sorted_results = results.sort(value); function value(a,b) { a = a[column]; b = b[column]; return a == b ? 0 : (a < b ? -1*direction : 1*direction) } } This works fine for the columns with strings. But it treats the columns of integers like strings instead of numbers. For example, the values 15, 1000, 200, 97 would be sorted 1000, 15, 200, 97 if "ascending" or 97, 200, 15, 1000 "descending." I've double-checked the typeof the integer values, and the script knows they're numbers. How can I get it to treat them as such?

    Read the article

  • Advise on starting a new job

    - by Sisiutl
    I hope this isn't too off-topic, but in a week I will start a new job at a manufacturing company managing the development of a new eCommerce site. The company scores about a 3 on the "Joel" test. I will inherit 3 programmers who developed the company web site and do general IT programming. I have the grey hair and credentials to have their initial respect but I'm an engineer, not a manager. I'm looking for practical advise - particularly for the first 90 days - on how to establish myself, keep the team together, and move forward.

    Read the article

  • Dynamics CRM Customer Portal Accelerator Installation

    - by saturdayplace
    (I've posted this question on the codeplex forums too, but have yet to get a response) I've got an on-premise installation of CRM and I'm trying to hook the portal to it. My connection string in web.config: <connectionStrings> <add name="Xrm" connectionString="Authentication Type=AD; Server=http://myserver:myport/MyOrgName; User ID=mydomain\crmwebuser; Password=thepassword" /> </connectionStrings> And my membership provider: <membership defaultProvider="CustomCRMProvider"> <providers> <add connectionStringName="Xrm" applicationName="/" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" name="CustomCRMProvider" type="System.Web.Security.SqlMembershipProvider" /> </providers> </membership> Now, I'm super new to MS style web development, so please help me if I'm missing something. In Visual Studio 2010, when I go to Project ASP.NET Configuration it launches the Web Site Administration Tool. When I click the Security Tab there, I get the following error: There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store. The following message may help in diagnosing the problem: An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax. Parameter name: connectionString I can't see what I'm doing wrong here. Does the user mydomain\crmwebuser need certain permissions in the SQL database, or somewhere else? edit: On the home page of the Web Site Administration Tool, I have the following: **Application**:/ **Current User Name**:MACHINENAME\USERACCOUNT Which is obviously a different set of credentials than mydomain\crmwebuser. Is this part of the problem?

    Read the article

  • [Silverlight] How to watermark a WriteableBitmap with a text

    - by Benjamin Roux
    Hello, In my current project, I needed to watermark a WriteableBitmap with a text. As I couldn’t find anything I decided to create a small extension method to do so. public static class WriteableBitmapEx { /// <summary> /// Creates a watermark on the specified image /// </summary> /// <param name="input">The image to create the watermark from</param> /// <param name="watermark">The text to watermark</param> /// <param name="color">The color - default is White</param> /// <param name="fontSize">The font size - default is 50</param> /// <param name="opacity">The opacity - default is 0.25</param> /// <param name="hasDropShadow">Specifies if a drop shadow effect must be added - default is true</param> /// <returns>The watermarked image</returns> public static WriteableBitmap Watermark(this WriteableBitmap input, string watermark, Color color = default(Color), double fontSize = 50, double opacity = 0.25, bool hasDropShadow = true) { var watermarked = GetTextBitmap(watermark, fontSize, color == default(Color) ? Colors.White : color, opacity, hasDropShadow); var width = watermarked.PixelWidth; var height = watermarked.PixelHeight; var result = input.Clone(); var position = new Rect(input.PixelWidth - width - 20 /* right margin */, input.PixelHeight - height, width, height); result.Blit(position, watermarked, new Rect(0, 0, width, height)); return result; } /// <summary> /// Creates a WriteableBitmap from a text /// </summary> /// <param name="text"></param> /// <param name="fontSize"></param> /// <param name="color"></param> /// <param name="opacity"></param> /// <param name="hasDropShadow"></param> /// <returns></returns> private static WriteableBitmap GetTextBitmap(string text, double fontSize, Color color, double opacity, bool hasDropShadow) { TextBlock txt = new TextBlock(); txt.Text = text; txt.FontSize = fontSize; txt.Foreground = new SolidColorBrush(color); txt.Opacity = opacity; if (hasDropShadow) txt.Effect = new DropShadowEffect(); WriteableBitmap bitmap = new WriteableBitmap((int)txt.ActualWidth, (int)txt.ActualHeight); bitmap.Render(txt, null); bitmap.Invalidate(); return bitmap; } } For this code to run, you need the WritableBitmapEx library. As you can see, it’s quite simple. You just need to call the Watermark method and pass it the text you want to add in your image. You can also pass optional parameters like the color, the opacity, the fontsize or if you want a drop shadow effect. I could have specify other parameters like the position or the the font family but you can change the code if you need to. Here’s what it can give Hope this helps.

    Read the article

  • Scrubbing a DotNetNuke Database for user info and passwords

    - by Chris Hammond
    If you’ve ever needed to send a backup of your DotNetNuke database to a developer for testing, you likely trust the developer enough to do so without scrubbing your data, but just to be safe it is probably best that you do take the time to scrub. Before you do anything with the SQL below, make sure you have a backup of your website! I would recommend you do the following. Backup your existing production database Restore a backup of your production database as a NEW database Run the scripts below...(read more)

    Read the article

  • Tellago Devlabs: A RESTful API for BizTalk Server Business Rules

    - by gsusx
    Tellago DevLabs keeps growing as the primary example of our commitment to open source! Today, we are very happy to announce the availability of the BizTalk Business Rules Data Service API which extends our existing BizTalk Data Services solution with an OData API for the BizTalk Server Business Rules engine. Tellago’s Vishal Mody led the implementation of this version of the API with some input from other members of our technical staff. The motivation The fundamental motivation behind the BRE Data...(read more)

    Read the article

  • Slides, Code, and Photos from SPTechCon San Francisco 2011

    - by Brian Jackett
    Note: This is a temporary post containing my slides and code from my session “The Expanding Developer Toolbox for SharePoint 2010” at SPTechCon San Francisco 2011.     Thanks to all of my attendees that came to “The Expanding Developer Toolbox for SharePoint 2010”.  They had such great questions that we ran out of time before covering all of the planned material.  I wanted to provide my slides and code samples so that you can walk through them sooner than later.  I’ll update this post after the event with a more complete post. Slides and Code   Click here for “The Expanding Developer Toolbox for SharePoint 2010” materials         -Frog Out

    Read the article

  • SharePoint 2007: Error message when adding a Web part to a list or library page

    - by Cherie Riesberg
    Sytmptom:   You have a list or document library page (allitems.aspx) and you are trying to add a Web part.  You get an error message: Unable to add selected Web part(s).  (name of Web part): The file is not checked out.  You must first check out this document before making changes. Publishing features are not turned on and it is not a page that lives in a library accessible by the GUI. Solution:  Open the site in SharePoint Designer and check out the page. Then, check in the page after modifications are done.  It seems like this is just a bug.

    Read the article

  • Automating and deploying new linux servers

    - by luckytaxi
    I'm in the process of developing a method to automate new virtual machines into my environment. 90% of our machines are virtual but the process is similar for both physical and vmware based images. What I do now is I use cobbler to install the base OS. The kickstart script has post hooks to modify the yum repo and installs puppet and func. Once the servers are running, I manually add them into nagios and sign the certificate via the puppetmaster. I've since migrated most of the resources to use mysql as the backend. I wanted to see what others are doing and my goal for 2011 is to have puppet inventory the hardware into mysql, and somehow i'll script a python script to have nagios grab the info and automatically add it for monitoring purposes. It's kind of tedious to have to add each new server into nagios, puppet's dashboard, munin, etc...

    Read the article

  • Blocking a specific URL by IP (a URL create by mod-rewrite)

    - by Alex
    We need to block a specific URL for anyone not on a local IP (anyone without a 192.168.. address) We however cannot use apache's <Directory /var/www/foo/bar> Order allow,deny Allow from 192.168 </Directory> <Files /var/www/foo/bar> Order allow,deny Allow from 192.168 <Files> Because these would block specific files or directories, we need to block a specific URL which is created by mod-rewrite and the page is dynamically created using PHP. Any ideas would be greatly appreciated

    Read the article

  • I have a perl script that is supposed to run indefinitely. It's being killed... how do I determine who or what kills it?

    - by John O
    I run the perl script in screen (I can log in and check debug output). Nothing in the logic of the script should be capable of killing it quite this dead. I'm one of only two people with access to the server, and the other guy swears that it isn't him (and we both have quite a bit of money riding on it continuing to run without a hitch). I have no reason to believe that some hacker has managed to get a shell or anything like that. I have very little reason to suspect the admins of the host operation (bandwidth/cpu-wise, this script is pretty lightweight). Screen continues to run, but at the end of the output of the perl script I see "Killed" and it has dropped back to a prompt. How do I go about testing what is whacking the damn thing? I've checked crontab, nothing in there that would kill random/non-random processes. Nothing in any of the log files gives any hint. It will run from 2 to 8 hours, it would seem (and on my mac at home, it will run well over 24 hours without a problem). The server is running Ubuntu version something or other, I can look that up if it matters.

    Read the article

  • VirtualBox cannot start a virtual machine on Windows 7

    - by Zan Lynx
    Note that this question is mostly so others can find this information. I ran into a problem recently with my Fedora-14 virtual machine running on a Windows-7 host with VirtualBox. VirtualBox could not start the Fedora virtual machine, but it could start a Ubuntu virtual server machine that was configured for 512 MB of RAM. The Fedora-14 machine was configured for 2 GB of RAM. The Fedora-14 machine had been working a week ago. What had I recently changed...? Answer to follow.

    Read the article

  • Barring connections if VPN is down.

    - by Majid
    I have a VPN account and use it for sensitive communication. However the VPN connection sometimes is dropped while my main connection to the internet is still alive. The pages I visit through VPN are on HTTP (not secure) and have javascript code which pings the host every minute or so on a timer. So it happens sometimes that the VPN connection is dropped and yet js sends a request to the server (with the cookies). How could I restrict connections so they only happen if the VPN is live? Edit - Some required details were missing OS: Windows XP SP2 Browser (mostly used): Google Chrome Firewall: Windows default Sites to filter: not all traffic but all in a list of sites like abc.com, xyz.com

    Read the article

  • Tools to manage sql 2008 database mirroring?

    - by lemkepf
    We are going to be moving about 20 databases that live on a single instance of sql 2000 to a sql 2008 r2 environment with database mirroring. What I'm looking for is a tool or scripts that will help me manage the conversion and management of those 20db's onto this new mirrored environment easily. There are many steps in setting each DB up and I want to automate as much as possible. Edit: Here are the steps I've been doing manually: Create the same username/passwords from the old sql 2000 server onto new sql 2008 server. Then sync those users/passwords onto the other sql 2008 server with the same SSID's so when we do the db backup and restore they match up. Take a backup of each sql 2000 db's. Copy them to server A. Restore the backup to server A. Backup from server a, copy to server b, restore there. Run the mirror "configure security" wizard. Start mirroring. I've love to be able to script this out or have a tool that does it for me. Thanks! Paul

    Read the article

  • Setting nagios location in map

    - by Mech Software
    I have Nagios installed and I'm working on getting the network map correct. The problem I have is that "Nagios" appears to be in the "internet" when it should be located on the MechNAS server. What I want is Nagios Process to show up inside the local network. So it should show up at the same layer as MechNAS and development. Where exactly is that configured? I didnt see any place to set that up and it looks now like it's out there on it's own. Documentation and Googling didnt seem to turn up anything either.

    Read the article

  • Windows 7, network shares, and authentication via local group instead of local user

    - by Donovan
    I have been doing some troubleshooting of my home network lately and have come to an odd conclusion that I was hoping to get some clarification on. I'm used to managing share permissions in a domain environment via groups instead of individual user accounts. I have a box at home running windows 7 ultimate and I decided to share some directories on that machine. I set it up to disallow guest access and require specifically granted permissions. (password moe?). Anyway, after a whole bunch of time i figured out that even though the shares I created were allowed via a local group i could not access them until i gave specific allowance to the intended user. I just didn't think i would have to do that. So here is the breakdown. Network is windows workgroup, not homegroup or nt domain PC_1 - win 7 ultimate - sharing in classic mode - user BOB - groups Admins PC_2 - win 7 starter - client - user BOB - groups admins PC_3 - win xp pro - client - user BOB - groups admins the share on PC_1 granted permission to only the local group administrators. local user BOB on PC_1 was a member of administrators. Both PC_2 and PC_3 could not browse the intended share on PC_1 because they were denied access. Also, no challenge was presented. They were simply denied. After adding BOB specifically to the intended share everything works just fine. Remember, its not an nt domain just a workgroup. But still, shouldn't i be able to manage share permissions via groups instead of individual user accounts? D.

    Read the article

  • Overcoming maximum file path length restrictions in Windows

    - by Christopher Edwards
    One of our customers habitually use very long path names (several nested folders, with long names) and we routinely encounter "user education issues" in order to shorten the path to less than 260 characters. Is there a technical solution available, can we flick some sort of switch in Windows 7 and Windows 2008 R2 to say "yeah just ignore these historical problems, and make +260 character path name work". P.S. I have read and been totally unedified by Naming Files, Paths, and Namespaces

    Read the article

  • Disk names in Solaris 10 for ZFS: SAS WWN instead of c0t0d0

    - by notpeter
    I currently have a server running Solaris 10u9 with a SAS enclosure (Dell PowerVault MD1000) filled with SATA disks attached to an SAS card (LSI 3801E). It happily recognizes the 15 disks in the MD1000 and presents them each disk in the traditional solaris form (c1t12d0, c1t13d0, c1t15d0, etc). My home ZFS setup (Nexenta CP3 + LSI 9200-16E + directly cabled SATA disks) presents disks as their SAS WWN ID (ex: c3t600039300001EA56d0). Although this ID is longer, I've found it much easier to troubleshoot because the cabling/slot is irrelevant, ZFS just identifies the disk by ID, if it's connected it finds it. Most manufacturers print the WWN right on the disk's top label, can't get much easier than that. So how can I get Solaris to identify disks by SAS WWN instead of by the cXtXdX?

    Read the article

  • Terminal Server Logging Software

    - by Jacob
    I have recently been trying to find software to monitor users' activities on our terminal server. After a quick search, I found http://www.softactivity.com/tsm.aspx. Has anyone ever heard of or used this program? I just want to make sure this company is legit and the software runs efficiently. The server I would be installing it on has about 40-50 users on it. I am hoping the software has some type of setting to only monitor certain users, because i would hate to waste resources. If this is not good software, does anyone have any recommendations?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >