Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

nhsal69

@nhsal69
About
Posts
42
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • recursive array search
    N nhsal69

    Ok, I've been staring at that for ages and my logic has vanished... I re wrote it to this the below.... Only problem is that I still don't get a valid response.. the array is of the form : [1] => Array ( [Name ] => Aberdeen [Status ] => Ready [Location ] => [Jobs ] => 0 [Model ] => HPUniversalPrintingPCL6 [Comment ] => PRINT_EARL The correct number of "@" are retuned so it's performing the correct number of itterations, but no giving me the results... I should have mentioned that I'm completely new to PHP and am kinda winging it.... Start of code chunk $it = new RecursiveIteratorIterator( new RecursiveArrayIterator($server1)); echo ""; foreach ($it as $key=>$val) { echo "@"; if ($val == "PRINT_EARL") { echo ""; echo ""; echo ""; echo ""; } Else echo $key.":".$val."\n"; } End of code chunk -- Modified Monday, May 3, 2010 10:51 AM

    "; echo $key; echo "

    "; echo $val; echo "

    Linux, Apache, MySQL, PHP database data-structures help

  • recursive array search
    N nhsal69

    Nope I just wanted to see what if anything was getting returned.. but it appears not.

    Linux, Apache, MySQL, PHP database data-structures help

  • recursive array search
    N nhsal69

    Hi there, I have a piece of code to search through a multidimensional array and return the keys of successful hits... The problem is that I can see it has checked all though the array (the echo "@"; shows an @ for each element of the array) but the matches are not returned, the array contains at least 30 "status" fields. Can anyone tell me where I'm going wrong.. Thanks Here is the code:

    $haystack = $server1 = $tx->extractTable();
    $needle = 'Status';
    $index = null;

    $aIt = new RecursiveArrayIterator($haystack);
    $it = new RecursiveIteratorIterator($aIt);

    while($it->valid())
    {       
        if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) {
        	
    	return $aIt->key();
    	
    	echo $aIt->key();
    
        }
    
    echo "@";
       
        $it->next();
    
    }
    
    
    
    return false;
    
    Linux, Apache, MySQL, PHP database data-structures help

  • Extract Html table info into PHP Array
    N nhsal69

    Hi All, I'm a nube to PHP but have done some VB scripting so thought I'd try this... I am trying to get table information from our print servers, we have 5 all use the Microsoft Internet Printing system, which uses IIS to generate a page populated with that servers printer information through a ASP generated web page (google IPP_0001.asp) to to see the code... My problem is that I want to extract the table information from each of the print servers (there are 5) collate all the tables into one uber table and then perform a search on that uber table to only show printers within a specific area... a standardised formatted area being one of the tables columns for each printer entry. I have the code to perform the searches and generate the final page, but I'm struggling to generate an array populated with the html table info. Can anyone point me in the right direction to get an array populated with Html table and then displayed.. thanks in advance.

    Web Development php html windows-admin data-structures help

  • Attaching a file to generated email
    N nhsal69

    Doh! thanks for that... I'll just get my coat.. TAXI!

    .NET (Core and Framework) csharp sysadmin help question

  • Attaching a file to generated email
    N nhsal69

    Hi All, I've got the following code, which runs an exe with some switches and then sends the log file to me, or at least it's supposed to. I receive the email ok, but no attachment.. the code compiles fine.. has anyone any ideas?? MyProcess.StartInfo.FileName = "printmig.exe" MyProcess.StartInfo.WorkingDirectory = "c:\print backup" MyProcess.StartInfo.Arguments = "printmig.exe /b /i" MyProcess.Start() MyProcess.WaitForExit() Dim objMail As New System.Net.Mail.MailMessage() Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient Dim Mailmsg As New System.Net.Mail.MailMessage Mailmsg.To.Clear() Mailmsg.To.Add(New System.Net.Mail.MailAddress("receivers address")) Mailmsg.From = New System.Net.Mail.MailAddress("senders address") Mailmsg.Subject = "(subject text)" Dim attachment As New System.Net.Mail.Attachment("C:\file.log") 'create the attachment objMail.Attachments.Add(attachment) 'add the attachment Try Mailmsg.Body = "" obj.Host = "external smtp server" ' Modify to YOUR smtp server obj.Send(Mailmsg) Catch ex As Exception Write("Error: " & ex.ToString()) Cheers nhsal69

    .NET (Core and Framework) csharp sysadmin help question

  • VB 2008 Express, Get Modified date stamp
    N nhsal69

    I now have a piece of code which scans a folder and reset the file names to the exact date and time the file was created.. The only problem is I need the modified time (these are all photos, and the modified time is the time the photo was taken) ever other time stamp has been changed when the files were copied from camera to phone etc. So FileInfo gives you: CreationTime LastAccessTime LastWriteTime as well as various other bits and bobs, but no Modified time. I can see it in the jpg files properties, so it must be getabe?? Any ideas??

    Visual Basic help

  • VB 2008 Express, Get Modified date stamp
    N nhsal69

    Luc Pattyn wrote:

    Andy Murray does.

    Yeah, he is renowned for his ability to code while serving.. all that shouting between points is critic of his SQL and systemfileinfo coding I need to listen more closely next game to get hints and tips...

    Visual Basic help

  • VB 2008 Express, Get Modified date stamp
    N nhsal69

    Ahh, thanks for that..

    Visual Basic help

  • VB 2008 Express, Get Modified date stamp
    N nhsal69

    Just one more thing... fsi.lastaccesstime, fsi.creationtime all appear to generate day moth year in teh form "23 March 2010" but I need it to include the hours mins and sec.. any ideas?? the example I'm using is: Imports System.IO Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' Loop through all the immediate subdirectories of C. For Each entry As String In Directory.GetDirectories("C:\temp\test") DisplayFileSystemInfoAttributes(New DirectoryInfo(entry)) Next ' Loop through all the files in C. For Each entry As String In Directory.GetFiles("C:\temp\test") DisplayFileSystemInfoAttributes(New FileInfo(entry)) Next End Sub Sub DisplayFileSystemInfoAttributes(ByVal fsi As IO.FileSystemInfo) ' Assume that this entry is a file. Dim entryType As String = "File" ' Determine if this entry is really a directory. If (fsi.Attributes And FileAttributes.Directory) = FileAttributes.Directory Then entryType = "Directory" End If ' Show this entry's type, name, and creation date. Console.WriteLine("{0} entry {1} was created on {2:D}", _ entryType, fsi.FullName, fsi.LastAccessTime) End Sub End Class Any thoughts?? Thanks

    Visual Basic help

  • VB 2008 Express, Get Modified date stamp
    N nhsal69

    What can I say, I'm diverse :P

    Visual Basic help

  • VB 2008 Express, Get Modified date stamp
    N nhsal69

    Smashing... thanks for that....

    Visual Basic help

  • VB 2008 Express, Get Modified date stamp
    N nhsal69

    Hi there, I'm pretty new to this but what I'm after is a method of getting the Last modified date from a file, then renaming the file to that data/time stamp.. If there are any duplicates then appending _1, _2 etc to them.... I've been looking for the correct file.getX and have found the file.getattributes, for hidden /readonly etc.. but can't find the correct one for file Properties, specifically modified time. Can anyone help... Thanks

    Visual Basic help

  • VB 2008 Express App install wants to install unnecessary components
    N nhsal69

    It's resolved now... I copied the entire Form1.vb and form1design.vb etc to notepad, created a new project and then pasted the code back into the new project.. This appears to have resolved the problem, I'm guessing that there must have been some residual "reference" somewhere which forced VB Express to require the above a pre-req, even tho they weren't utilised in the code... thanks for you thoughts anyway...

    Visual Basic database csharp sysadmin help question

  • VB 2008 Express App install wants to install unnecessary components
    N nhsal69

    Morning.... I didn't do anything... You click on Builds, then Publish.. You select a path and then whether the clients will want automatic updates and then that it... The setup files appear in the designated folder, the client runs them and then get prompted to install .Net 3.5 and SQL Express 2008.... Are these components defined in the code somewhere, or when the build is completed?? As it doesn't appear obvious. As a side note, the application was designed and tested using connections to SQL Express (Locally installed), but then the connection strings were changed to use SQL 2005 (full vers)

    Visual Basic database csharp sysadmin help question

  • VB 2008 Express App install wants to install unnecessary components
    N nhsal69

    Hi folks, I have created an app which takes a SQL table from a SQL 2005 server (separate from the machine running the application) queries it in some nice ways and generates an Excel spreadsheet with the required data. The problem I have is that when I publish the App and get another machine to install it using the "setup" file created, it wants to download and install: .Net Framwork 3.5 SQL 2008 Express edition Both take ages to download and install and I don't see why the SQL Express is required. Can I stop this process from happening as part of the install. Are they BOTH necessary?? Just to point out, AFAIK there is definitely no requirement for SQL 2008 Express to be installed on the client, the app just uses a connection string to connect to the remote database and queries are passed as strings.. Thanks

    Visual Basic database csharp sysadmin help question

  • Problem in VB while trying to execute SQL Code
    N nhsal69

    Problem resolved, here is the code for the SQL connection: Dim mycon As New SqlConnection(conString) Dim SQLConn As New SqlConnection() 'The SQL Connection Dim SQLCmd As New SqlCommand() 'The SQL Command SQLConn.ConnectionString = myconnection 'Set the Connection String SQLConn.Open() 'Open the connection SQLCmd.Connection = SQLConn 'Sets the Connection to use with the SQL Command SQLCmd.CommandText = SQLStr 'Sets the SQL String **SQLCmd.CommandTimeout = 60** SQLCmd.ExecuteNonQuery() 'Executes SQL Commands Non-Querys only SQLConn.Close() 'Close the connection mycon.Close() Console.WriteLine("Connection Closed") The Bolded lin ei the new one which resolves my issue.. Thanks

    Visual Basic help database xml

  • Problem in VB while trying to execute SQL Code
    N nhsal69

    the full error is: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." This only occurs when the input files are the "large" ones, they also use the same variables "first and "second" as the small ones which complete successfully. After a bit of further investigation it appears as it is only when the VB send the calculation query to SQL that the error occurs (it creates the tables, which is the previous step)... I am attempting to increase the timeout period from default of 15 sec to more but this doesn't appear to resolve the problem... Any thoughts??? ***edit*** when stepping though the code and executing the "SQLCmd.ExecuteNonQuery()" it takes a count of approx 30 before the timeout error occurs, no matter what the "Connection Timeout=***;" in the connection string is set to...

    Visual Basic help database xml

  • Problem in VB while trying to execute SQL Code
    N nhsal69

    The error generated is: A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Which is not really of any help, as this is the standard error when anything goes wrong when working with SQL from VB....

    Visual Basic help database xml

  • Problem in VB while trying to execute SQL Code
    N nhsal69

    Hi there, wonder if you can help... I have a piece of VB code which uploads 2 large XMLs to SQL and then more code which allows the manipulation of the data to provide various bits of info which is then presented to Excel.. I was initially uploading each test XML file which were about 40K lines which made 16K Rows in each SQL table. I could then compare the two tables. The implementation requires XMLs of around 660K lines which, after uploading, become 144763 and 146741 rows in each table in SQL. My problem is that the statement I was using to compare these two tables, which worked with test data fails (no error is given) here is the code: SQLStr = "Select * into Temp_Delete_Oldest from " & First & " Select * into Temp_Delete_Newest from " & Second & " DELETE Temp_Delete_Oldest FROM Temp_Delete_Oldest INNER JOIN Temp_Delete_Newest ON Temp_Delete_Newest.Fullpath = Temp_Delete_Oldest.Fullpath" This works in SQL when it is entered as a New Query but fails when implemnted from the VB code. So, does anybody know why this fails and what I can do to stop it failing, bearing in mind it works with smaller SQL tables.... Cheers nhsal69

    Visual Basic help database xml
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups