BenWard 8 Newbie Poster

OK, so I have found nothing that suits my needs so I thought I'd have a look at making something.

here's what I have so far;

scrolly.png

<ion-view view-title="Camera Settings">
    <ion-content class="has-header">
        <ion-list>
        <ion-item>
        Current ISO is 400
        </ion-item>
        <ion-item style="padding: 0px; margin-bottom: 0px; line-height: 1;">
            <div style="text-align:center; padding: 16px;">Aperture:</div>
            <ion-scroll direction="x" zooming="false" has-bouncing="false" style="width: 100%;">
                <!-- this is where we put the content that needs to be selected by the scrollier. -->
                <div style="width: 2000px; color: white; background: #387ef5; padding: 16px 16px 21px 16px;">1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27</div>
            </ion-scroll>
            <div style="position: relative; top: -15px;">
                <div style="height: 10px; padding: 0px;">
                    <div style="position: absolute; left: 50%; width: 0; height: 0; border-left:10px solid transparent; border-right: 10px solid transparent; border-bottom: 10px solid white; margin-left: -5px;"></div>
                </div>
                <div style="background: white; padding: 16px 16px 0px 16px; text-align: center;">f/8.7</div>
            </div>
        </ion-item>
        <ion-item style="padding: 0px; margin-bottom: 0px; line-height: 1;">
            <div style="text-align:center; padding: 16px;">Shutter Speed:</div>
            <ion-scroll direction="x" zooming="false" has-bouncing="false" style="width: 100%;">
                <!-- this is where we put the content that needs to be selected by the scrollier. -->
                <div style="width: 2000px; color: white; background: #387ef5; padding: 16px 16px 21px 16px;">8 - 4 - 2 - 1 - 1/2 - 1/4 - 1/8 - 1/15 - 1/30 …
BenWard 8 Newbie Poster

Hi,

If you want to learn about programming in PHP then we'll be happy to offer some guidance and help you learn but understand no-one here is going to write a solution for you - you simply won't learn anything that way.

If you want to get the submitted firstname into the body of the email you need to do something with your line $message = file_get_contents('template.php'); here, template.php will not be executed as a program, it will just be READ as a text file. It may as well be template.txt or template.htm.

I would probably do some hack here just to get it working but this would not be my normal way of doing an email in PHP at all - but that's just me. I use PHPMailer myself for any mailing that needs doing from PHP and don't personally use separate template files.

My hack to your current solution would go along the lines of editing your template.php to add 'tags' (e.g. where you want to put your name variable add the text %NAME% or something like that to the template) then use string manipulation functions on $message to replace each instance of the tag with the actual $firstname variable.

Recommended reading;
str_replace
mail

These manual pages if you haven't already looked at them should help you understand what the program is doing.

Have fun!
Ben

BenWard 8 Newbie Poster

In case anyone else has similiar issues and finds this whilst googling etc, a colleague assisted with this and we resolved by using just 1 button instead of 2 and using a ternary operatror in the ng-class angular attribute to switch the class out;

<div class="buttons">
    <button ng-class="player.paused ? 'ion-play' : 'ion-pause'" class="button  button-clear icon" ng-click="player.playPause()"></button>
</div>
BenWard 8 Newbie Poster

Hi Guys,

I'm after a user interface element for ionic that operates like a cross between a range slider http://ionicframework.com/docs/components/#range and spinner.

Essentially the 'button' or tag that you would drag from side to side in a range needs to stay in the middle, but as you swipe, the scale in the background slides past it. The idea is for a simple camera exposure calculator and I want the settings to resemble looking down onto a camera lens from above and rotating the aperture ring or shutter speed selector. The camera body has an arrow pointing to some point on the ring and as you rotate it, the scale/numbers rotate past the pointer.

Before I go and spend 47 hours cobbling together a poorly written attempt at this with a combination of dodgy css and 'borrowed' JS canvas code that doesn't work properly and runs slow, does anyone know of an existing open source CSS/JS/HTML5 ui element that does this or that I could more easily customise/modify?

any ideas would be much appreciated :)

Thanks
Ben

BenWard 8 Newbie Poster

Don't have time to read through your code properly but I'd probably do something like default tempValue to null, reset tempValue to null at the end of an operation and then check if tempValue is null before performing an operation. This would ensure that the operators only actually operate when there is a newly entered value upon which to operate.

BenWard 8 Newbie Poster

Hi Guys,

I've been playing around with Angular and Ionic tutorials and I'm attempting to put together things I've learnt from different tutorials to build a simple NPR audio player.

I have a really really anoying issue with ng-show/ng-hide...

Basically, in the bottom left hand corner of my application I have a play/pause button. Acutally it's 2 buttons, a play button and a pause button, they are both supposed to occupy the same space (i.e. only one of them being visible at once) so I have used ng-show and ng-hide on them. When player.paused is true, the play button is visible, when player.paused is false, the pause button is visible. Clicking either button triggers the player.playPause() function via ng-click which will be used to actually control the audio playback. One of the actions of this function is to toggle player.paused.

It works fine, you click the play button, it hides the play button and replaces it with a pause button and vice-versa. The issue is that for a split second both buttons are visible as Angular seems to give priority to making things visible over making things invisible. I snapped the below screenshot in the moments where both were visible so you can see...

npr.png

heres the html:

<div ng-show="player.playing" class="bar bar-footer bar-royal">
    <div class="buttons">
        <button ng-show="player.paused" class="button  button-clear icon ion-play" ng-click="player.playPause()"></button>
        <button ng-hide="player.paused" class="button  button-clear icon ion-pause" ng-click="player.playPause()"></button>
    </div>
    <div class="title"><h5>--progress bar to go here--</h5></div>
    <div class="buttons">
        <button class="button icon button-clear ion-stop pull-right" ng-click="player.toggle();"></button>
    </div> …
BenWard 8 Newbie Poster

Hello Cereal,

Thanks for your reply. Unfortunately splitting this into 2 curl_execs has not resolved the issue :(

I shall investigate further!

BenWard 8 Newbie Poster

Hello,

I'm having some trouble with CURL. I'm trying to use a web service to get a customer's name and address but it fails to send my post data when I use NTLM proxy authentication.

$xmlToSend = 
"<?xml version=\"1.0\" ?> <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:dat=\"$this->service\"> <soapenv:Header /> <soapenv:Body> <dat:CustomerDataRequest> <dat:SystemAuthentication> <dat:username>$this->user</dat:username> <dat:password>$this->pass</dat:password> </dat:SystemAuthentication> <dat:ReferenceNumber>$this->queryReference</dat:ReferenceNumber> </dat:CustomerDataRequest> </soapenv:Body> </soapenv:Envelope>
";


            $ch = curl_init($this->service . ".php");
            curl_setopt($ch, CURLOPT_HEADER, false);
            curl_setopt($ch, CURLOPT_PROXY, $this->proxyServer);
            curl_setopt($ch, CURLOPT_PROXYPORT, 8080);
            curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->proxyUPD);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
            curl_setopt($ch, CURLOPT_HTTPHEADER, Array ('Content-type: text/xml'));
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlToSend);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

Now the issue appears to be with line 24: curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);

If I comment this out, everything works fine but it sends the proxyUPD string to the proxy server in plain text (bad)

If I leave it in, it authenticates on the proxy server using NTLM with the password encrypted (good) but the $xmlToSend is dropped by the proxy server on the way through to the target so the web service errors telling me that I did not send any XML.

Has anyone else come accross similar issues here? This is a problem for me because we are upgrading our proxy server and the new one does not support plain text authentication.

I'm not sure if this is maybe a bug in CURL or just that I'm missing something fundamental about the whole proxy concept??

Cheers
Ben

BenWard 8 Newbie Poster

...

good lord I could kiss you right now and I don't even care if you're a dude.

I hadn't previously been using LookupAccountSidW() but the issue was still there before because the compiler was defaulting to wide chars anyway.

BenWard 8 Newbie Poster

Thanks, I thought that is effectively what lines 23 and 24 are doing? Or are you refering to the variables that I currently have as DWORDs and am passing as references?

BenWard 8 Newbie Poster

Hello,

I thread hijacked earlier today... probably shouldn't have, sorry if that annoyed anyone.

Anyway I have an issue using LookupAccountSid in a visual studio 2013 project running on Windows 7 Pro x64.

First of all, it works perfectly in debug, but doesn't work when built for release. What I think is happening is somewhere along the lines a variable is being assigned a NULL reference so when it is accessed an ACCESS_VIOLATION (c00....05) occurs in ntdll.dll.

When running in debug mode, the debug runtime uses a different memory location for NULL pointers so even though a NULL pointer is being referenced, I don't get the general protection fault.

Now the fact that this NULL pointer is being accessed does not seem to have any bearing on the actual functionality of the application as running in debug not only compiles and runs but actually outputs exactly the right data.

SO

Here's where I'm at. I think I need to either prevent the program from attempting to access a NULL pointer OR (this may well be completely retarded) somehow set a default memory location for NULL pointers that will not cause a GPF?! (a la run the application in a closer environment to 'debug mode') as mentioned, this is possibly a completely stupid idea...

What I've determined so far...

The exception occurs when calling LookupAccountSidW().

This is part of the Win32 API and takes a pointer to a SID (PSID) then from this looks up a string value for the domain …

BenWard 8 Newbie Poster

Holy thread revival batman!

I am today having this exact same issue :(

I have a loop that goes:

get a directory
for each subdirectory
    get DACL from subdirectory
    for each ace
        get the sid
        if allow or deny
            isValidSid() ? YES






            LPWSTR myTrusteeName = _T(""), myDomainName = _T("");
            DWORD myDwordNameLength = 0, myDwordDomLength = 0;
            SID_NAME_USE myNameUse = SidTypeUnknown;

            //Make an initial lookup to find out how big the names are
            LookupAccountSidW(
                NULL
                , mySid
                , NULL
                , (LPDWORD)&myDwordNameLength
                , NULL
                , (LPDWORD)&myDwordDomLength
                , &myNameUse
                ); //at this point error 122 is thrown as the length of myTrusteeName is too short.


            //alter the size of these variables rather than just getting the 1st letter and some gibberish
            myTrusteeName = (LPWSTR)GlobalAlloc(GMEM_FIXED, myDwordNameLength);
            myDomainName = (LPWSTR)GlobalAlloc(GMEM_FIXED, myDwordDomLength);

            //do the lookup again this time with genuine sizes
            BOOL it_dun_gud_ya = LookupAccountSidW(
                NULL
                , mySid
                , myTrusteeName
                , (LPDWORD)&myDwordNameLength
                , myDomainName
                , (LPDWORD)&myDwordDomLength
                , &myNameUse
                );

            //find out if we got a valid SID
            if (it_dun_gud_ya){
                if ((_tcslen(myTrusteeName) == 0) && (_tcslen(myDomainName) > 0)){
                    myOutputRow << myDomainName << "\"," << type;
                }
                else if ((_tcslen(myTrusteeName) > 0) && (_tcslen(myDomainName) == 0)){
                    myOutputRow << myTrusteeName << "\"," << type;
                }
                else if ((_tcslen(myTrusteeName) > 0) && (_tcslen(myDomainName) > 0)){
                    myOutputRow << myDomainName << "\\" << myTrusteeName << "\"," << type;
                }
                //wcout << myOutputRow.str() << endl;

            }

ELSE NOT a valid sid ? continue...

On the first iteration it works fine but subsequent iterations I get an access violation on what looks …

BenWard 8 Newbie Poster

Worth noting that args does not have to be called args. you could quite easily have the main method look like this:

public static void main(String[] shiverMeTimbers)

This would however be bad practise and is simply put, a little bit silly so you're unlikely to see it a lot.

BenWard 8 Newbie Poster

To expand on the previous answer look at this line of code... Apologies if you're already familiar with this but given the question I got the impression you might not have had this explained to you.

public static void main(String[] args)

This method called main is the method/function that runs when you execute a program from the command line. This is generally speaking always the case. When reading someone else's command line program code, look for this line as it's the place the code starts to execute.

Anything you type into the command line as a paramater to the program gets translated directly into a parameter for this method.

This method called main takes as its parameter an array of Strings called args so any words you type into the command line become elements in the array called args when it runs.

to illustrate;
java myProgram first second hello 1024.121

Thsi will start the program and args will have the following values in it:
args[0] == "first"
args[1] == "second"
args[2] == "hello"
args[3] == "1024.121"

From there it is a simple case of looking through the code for places where 'args' is referenced, ie what method wants args[0], and working out what you need to pass in.

That's how stultuske was able to identify the required parameters for the Sender. It looks like the Receiver has only 1 parameter.

BenWard 8 Newbie Poster

Don't forget multiplying and dividing by a negative number is perfectly valid so /- is a valid combination of operators.

BenWard 8 Newbie Poster

You could make a list of invalid combinations of opertors eg /*, */, ++ etc and stick them in a static final array. Loop through them comparing them to your input with String.contains(). It wouldn't matter if you had +++ entered by the user because ++ will still get picked up there. Also add your non-numeric characters to that array so the user cannot type (29-fred/98)

Saying that, I'd sooner do validation at input stage that checks each character entered as they are entering it.

BenWard 8 Newbie Poster
BenWard 8 Newbie Poster

What exactly is your issue? Is the table not giving you any rows or is your alternating background not working?

I normally assign attributes to the cell not the row, but I do this with CSS not old-school attributes eg style="backgound-color: white;"

BenWard 8 Newbie Poster

Thanks this does work.

I have taken it a step further and used the PHP htmlentities() function so it will cater for other characters as well if they come up.

It still looks like a strange issue to me as JavaScript supposedly uses UTF-16 for strings which shouldn't have any trouble at all with £ signs so I'm none the wiser as to where exactly the issue is occurring and that bothers me!

Thanks for your help.

BenWard 8 Newbie Poster

Hi, I'm struggling to see exactly what you're after here.

Is http://www.mysite.com/myscript.php?getime returning "10:00 AM" and you want to convert it to 20140424100000?

If so I'd probably go with somthing like:

$timeString = "10:00 AM";
$dayIncrement = 0;

$myYear = 2014;
$myMonth = 4;
$myDay = 24;

//separate the time from AM/PM
$timeArray = explode(" ",$timeString);

//separate hours and minutes
$timeArray[0] = explode(":",$timeArray[0]);

//make it a 24 hour clock
if (($timeArray[1] == "PM") && ($timeArray[0][0] < 12)){
    $timeArray[0][0] +=  12;
}

//if the hour is 12 AM this is a special time as it is midnight
if (($timeArray[1] == "AM") && ($timeArray[0][0] == 12)) {
    $timeArray[0][0] =  0;
    //I am of the impression that this triggers a new day in your requirements
    $dayIncrement = 1;
}

$myNewTimeString =  str_pad((string) $timeArray[0][0], 2, "0", STR_PAD_LEFT);
$myNewTimeString .= (string) $timeArray[0][1];
$myNewTimeString .= "00"; //we don't have the seconds to use.

//0 pad
$myMonth = str_pad((string) $myMonth, 2, "0", STR_PAD_LEFT);

//increment day if necessary
$myDay += $dayIncrement;
$myDay = str_pad((string) $myDay, 2, "0", STR_PAD_LEFT);

//build the date string
$myDateString = (string) $myYear;
$myDateString .= $myMonth . $myDay . $myNewTimeString;

echo $myDateString;

I haven't tested this and like I said I'm not sure what your actual requirements are :) but assuming this is the sort of thing you're after it shouldn't be too hard to build it into a function/class.

Happy coding :)
Ben

BenWard 8 Newbie Poster

Hi,

I'm not sure of any such applications out there, there may be one somewhere but your requirements are too specific to be likely to find an exact match amongst the opensource gallery projects out there.

You might do best to build your own on top of an existing full-featured UI framework like jquery ui

http://jqueryui.com/

Happy coding
Ben

BenWard 8 Newbie Poster

Hello,

I'm having some trouble with a £ sign, it's being displayed to the user as the <?> question-mark-in-a-black-diamond icon.

I have an SQL Server database with a £ in a table. (Collation Latin_General_C1_AS which is analoguous to 8859-1)

I have a PHP script which retreives this record without issue and can display it on a web page OK. This is with the PHP script file's encoding set to UTF-8 without BOM.

The issue appears to be displaying the page in an AJAX request.

var http = new XMLHttpRequest;
...
    document.getElementById('myDivElement').innerHTML = http.responseText;

http.responseText appears to be treating the results of the response text as plain old binary ascii and therefore loosing the £ character.

I'm sure this has to be a common issue as JS/AJAX is everywhere now and £ signs are kind of common in the United Kingdom (usually coloured in red and preceded by a - sign if my online banking is anything to go by)

I must be overtired/undercaffeined or something because I have tried and failed to work the Google machine to find the answer.

What is the usual resolution to displaying a £ sign through an AJAX request please?

Thanks
Ben

BenWard 8 Newbie Poster

Thanks

BenWard 8 Newbie Poster

Hi,

You need to check your php.ini. It looks as though your php has not loaded the sqlsrv extension.

http://docs.gurock.com/testrail-admin/howto-installing-sqlsrv

be aware that there are 2 sql server drivers;

  1. mssql (old & community supported, but available on linux)
  2. sqlsrv (new and microsoft supported, NOT available on linux)

the drivers for these are php_mssql.dll and php_sqlsrv.dll respectively.

It would seem likely to me that you either haven't enabled either driver in your php.ini OR you have enabled the mssql driver instead of the sqlsrv one.

note: just typing extension=php_sqlsrv.dll into your ini wont help if the binary dll file isn't there on your machine.

Regards,
Ben

pixelsoul commented: you hit it right on the head +8
BenWard 8 Newbie Poster

Funny enough I'm doing a very similar thing right now. I couldn't find a solution native to the language I originally used (VBScript) by googling so what I did was create a custom ghostscript script PDF2PDF and call it from the OS shell. I'm now porting the program to PHP and was going to just use the same solution - I'd be interested to see if the geniuses here have a native PHP solution! My docs start off as BZ2 postscript, so I shell out to decompress, shell out to convert to PDF then shell out again to extract the desired pages from the PDF. ouch...

BenWard 8 Newbie Poster

I had to map a network drive with specific credentials in my PHP script and it kept falling over because I'd already navigated to the drive in windows explorer.
This snippet will unmap a network drive using COM regardless of whether or not there is a drive letter associated with it or not. I can call this bit of code before I attempt the mapping to make sure that the program doesn't fall over.

BenWard 8 Newbie Poster

I think you need mssql_connect() or mssql_pconnect() dont you?

BenWard 8 Newbie Poster

Thanks for taking the time to reply.

That's fascinating and at the same time rather worrying that arrays of one type are treated differently from arrays of another. I tested this further using an array of mixed values.

class bicycle
{
    private $color;
    public function setColor($color)
    {
        $this->color = $color;
    }
    public function getColor()
    {
        return $this->color;
    }
}
$bicyclesArray = array();
$bicycle1 = new bicycle();
$bicycle1->setColor("purple");
$bicycle2 = "red";
$bicycle3 = new bicycle();
$bicycle3->setColor("black");
$bicyclesArray[] = $bicycle1;
$bicyclesArray[] = $bicycle2;
$bicyclesArray[] = $bicycle3;
echo "before changing the colors:<br/>";
var_dump($bicyclesArray);
foreach ($bicyclesArray as $bicycle)
{
    if (is_string($bicycle)){
        $bicycle = "blue";
    } else {
        $bicycle->setColor("blue");
    }
}
echo "<br/>after changing the colors:<br/>";
var_dump($bicyclesArray);

output:

before changing the colors:<br/>array(3) {
  [0]=>
  object(bicycle)#1 (1) {
    ["color":"bicycle":private]=>
    string(6) "purple"
  }
  [1]=>
  string(3) "red"
  [2]=>
  object(bicycle)#2 (1) {
    ["color":"bicycle":private]=>
    string(5) "black"
  }
}
<br/>after changing the colors:<br/>array(3) {
  [0]=>
  object(bicycle)#1 (1) {
    ["color":"bicycle":private]=>
    string(4) "blue"
  }
  [1]=>
  string(3) "red"
  [2]=>
  object(bicycle)#2 (1) {
    ["color":"bicycle":private]=>
    string(4) "blue"
  }
}

so even within the same array 2 elements are treated differently. It would seem that foreach returns either the array element's value or a reference to it depending on the element's type.

Am I being silly here?

Ta
Ben

BenWard 8 Newbie Poster

try this :

select t1.category_name, t1.high_value_complaints, t2.high_value_duplicate_complaints from
(......query 1 stuff) as t1
JOIN
(.....query 2 stuff) as t2
ON t1.category_name=t2.category_name
BenWard 8 Newbie Poster

Thanks for posting but that does nothing to answer my question.

BenWard 8 Newbie Poster

maybe try to alias the table in your join and don't use select *

BenWard 8 Newbie Poster

Hi,

I've got a class in PHP with an array of objects in it.

I need to loop through these objects and call 2 methods on them but I'm not sure of the best approach.

When dealing with arrays, if you use foreach, you can't seem to update the actual array. Example:

$foo = array ("first","second","third");

$x=1;

print_r ($foo);

foreach ($foo as $current){
    $current = $x++;
}

print_r ($foo);

outputs the following:

Array
(
    [0] => first
    [1] => second
    [2] => third
)
Array
(
    [0] => first
    [1] => second
    [2] => third
)

so if $foo contains objects and not simply strings, if I call a method in that object which sets some property, as soon as the foreach moves to the next object in the array that change will be destroyed. This is pointless.

I have devised a possible solution to this as per the below:

$foo = array ("first","second","third");

$x=1;

print_r ($foo);

foreach ($foo as $current => $randomUselessVariable){
    $foo[$current] = $x++;
}

print_r ($foo);

this has the desired output:

Array
(
    [0] => first
    [1] => second
    [2] => third
)
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
)

It does however bother me a little that $randomUselessVariable is being created for no good reason and if the object happened to be a large one it might slow down the execution quite badly.

Everything I've found by searching suggests using foreach ($values as $value) and the examples …

BenWard 8 Newbie Poster

Hi thanks for reply. This isn't jQuery it's a class I wrote myself. It's becuase I didn't define the ID in the <input > tags.

I really ought to read up on jQuery - looks like it might prove useful!

BenWard 8 Newbie Poster

Hello,

Whilst writing this I actually fixed the issue but I thought I'd post anyway as this technique might be useful to others...

I have a javascript class I wrote (alas I can't post the whole code as the IP technically belongs to the company I work for) which presents 3 drop down boxes, 1 for day, 1 for month and 1 for year. If you select an invalid date (eg 30th feb), it automatically updates itself to a near correct date (eg 28th feb) the class handles leap years.

This sadly doesn't work in chrome and I'd appreciate if anyone is interested could offer some small amount of guidance to get me going in the right direction....

You add your date picker to your form like this:

        <script type="text/javascript"> 
            var processDateVbl = new dateDropper('processDate', "<?php echo $currentDate; ?>");
        </script>

The class definition itself is pretty weird and works perfectly on IE.

Its constructor sets a few variables like how many days there are in each month and the min and max years to be added to the year select box etc and does some validation on the date string passed to it (in the php echo). Importantly, the constructor uses the first parameter (processDate) and suffixes it with Vbl and stores it as a parameter so that it can call itself later on...

It then calls a method called drawFields()

drawFields uses document.write to output form elements to the page;

    document.write ("<input type=\"hidden\" name=\"" …
BenWard 8 Newbie Poster

Hello you wonderful people you.

I am getting most upset with a pathetically unimportant bit of code.

I have an iFrame. This iFrame loads a php script, the php script is not however html, it is a pdf document generated on the fly with FPDF.

I have a second iFrame, this has a spinny gif 'loading' thingy.

both iFrames have the same dimensions, one is set to display: block; whilst the other is set to display: none;

I can make the browser load the pdf document in the iFrame whilst display is none, and the loading screen is hapily spinning around, unfortunately, I have had absolutely no luck in triggering the display to switch to block on the pdf and none on the loading screen once the pd has loaded completely.

document.window.getElementById('myPdfFrame').complete doesnt help me
document.window.getElementById('myPdfFrame').window.status is undefined

the iFrame onload is only triggered the first time the parent page is loaded.

im stuck!

any ideas?
Thanks,
Ben

BenWard 8 Newbie Poster

OK I just realised that the table USED to have an auto-incremental field for iMapId and I hadn't updated the tableadapter since.

what a silly billy....

BenWard 8 Newbie Poster

Hello,

I'm having some trouble with SQL CE.

The below code *should* insert a record into the 'maps' table. (table adapters all set up)

sometimes it says cannot insert as breaching primary key constraint, which is fine, but it otherwise fails with cannot insert NULL into iMapId. I have checked and txtNumber.Text.ToString is not null, and I've even tried explicitly setting newMap["iMapId"] equal to some integer and it still complains that it's null.

try
            {
                DataRow newMap = mapappdbDataSet.maps.NewRow();
                newMap["iRegionId"] = Convert.ToInt16(cmbRegion.SelectedValue);
                newMap["vMapName"] = txtMapNAme.Text.ToString();
                newMap["iMapId"] = txtNumber.Text.ToString();


                mapappdbDataSet.maps.Rows.Add(newMap);
                mapsTableAdapter.Update(newMap);
                mapappdbDataSet.AcceptChanges();

                this.Close();
            }
            catch (Exception excp)
            {
                MessageBox.Show("That didnt work. Heres the message: " + excp.Message.ToString());
            }

Any ideas at all?

Thanks