
joshuaand
Avatar/Signature-
Posts
46 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by joshuaand
-
Hi, Ok I am importing an XML document via a stored procedure, works a treat. I am new to stored prcedures so excuse me if the question is stupid. Below is my current stored procedure, which takes an XML document, and adds all the data to my database, in 2 fields. CREATE PROCEDURE dbo.report_event @doc ntext AS SET NOCOUNT ON DECLARE @idoc int EXEC sp_xml_preparedocument @idoc OUTPUT, @doc BEGIN TRANSACTION INSERT dbo.event_data SELECT attribute_type, attribute_value FROM OPENXML(@idoc, '/Event/*') WITH ( attribute_type varchar(64) '@mp:localname', attribute_value nvarchar(1024) 'child::text()' ) COMMIT TRANSACTION EXEC sp_xml_removedocument @idoc What I want to do is rewrite this bit: WITH ( attribute_type varchar(64) '@mp:localname', attribute_value nvarchar(1024) 'child::text()' ) To add the 'child::text()' value (the value of @mp:localname), to the table, instead of to a field called attribute_value, to the name of the node '@mp:localname' So when adding, I am writing the value of the node: 'child::text()' to the name of the node '@mp:localname' (which I have setup in my database) Any help is apprecaited.
-
SP2 Problem? With "GetDriveType" API Call
joshuaand replied to joshuaand's topic in Directory / File IO / Registry
Thanks! Thankyou, I used a base of your code to end up with the following, which gives me everything: Hello, TextBox1.Text = "" Dim diskClass As New ManagementClass("Win32_LogicalDisk") Dim disks As ManagementObjectCollection = diskClass.GetInstances() Dim disksEnumerator As ManagementObjectCollection.ManagementObjectEnumerator = disks.GetEnumerator() While disksEnumerator.MoveNext() Dim disk As ManagementObject = DirectCast(disksEnumerator.Current, ManagementObject) Dim propNames As StringCollection = New StringCollection Dim props As PropertyDataCollection = diskClass.Properties For Each driveProperty As PropertyData In props propNames.Add(driveProperty.Name) Next TextBox1.Text &= " Drive " & disk("deviceid").ToString & "\ Properties: " & vbCrLf Dim idx As Int16 = 0 For Each strProp As String In propNames If Not disk(strProp) Is Nothing Then TextBox1.Text &= strProp & ": " & disk(strProp).ToString Else TextBox1.Text &= strProp & ": NOTHING" End If TextBox1.Text &= vbCrLf Next TextBox1.Text &= vbCrLf & vbCrLf End While -
SP2 Problem? With "GetDriveType" API Call
joshuaand posted a topic in Directory / File IO / Registry
Hello, I am getting a drives type, (Removable Media, HDD, cd rom), and displaying it to the user. Works great, but not on SP2, it returns a weird drive type (8975933078237085698) It should return: "9222812402616107010" = Check for Removable Media "9222812402616107011" = Check For HardDisks "9222812402616107013" = 'Check for Cd-Roms But as you can see not even close. Below is the code, anyone know why this is an issue???????? Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long Dim strDrives As String() = Environment.GetLogicalDrives() Dim drive As String For Each drive In strDrives Dim strType As String = GetDriveType(drive) Dim driveSTR As String = "Unknown Type : " TextBox1.Text &= (drive & " is type : ") Select Case strType Case "9222812402616107010" 'Check for Removable Media driveSTR = "Removable Media" Case "9222812402616107011" 'Check For HardDisks driveSTR = "Hard Disc" Case "9222812402616107013" 'Check for Cd-Roms driveSTR = "CD-ROM" Case Else driveSTR &= strType End Select TextBox1.Text &= driveSTR & vbCrLf Next -
Yeah Javascript will allow them to find the files, that cant hapen. I used the above code and it works fine, also incorporated the inline filename property sot hey can save it as the original finename, uand used a simple encryption technique to encrypt the ID etc that I am passing to it, works a treat. Thankyou all for your help
-
Hi, I was browsing the web yesterday and I found a page that shoed you how to hide the URL information of a file but still allowed you to get that file (eg an image etc), but I cant remember where I found it and cant find it in my history, so if anyknow knows what I am talking about some help would be apprecaited. thanks joshua
-
Hello, Just wondering if anyone knows how to change the selection color on a treeview, its currently dark blue by default and I dont know how to change it, do you have to override thepain event or something? If so anyone know how to? thankyou joshua
-
Reize JPEG Image WITHOUT compresssing it??
joshuaand replied to joshuaand's topic in Graphics and Multimedia
it doesnt matter, if you actually tried the code as supplie dyou will see that when you DO NOT change the dimensions, you can save out a jpeg the does not decrease in size, otherwise a compression about a 1meg file to a 60kb file is obtained. yes it already is compressed, but thats not the issue -
Anyone Know how to Make Listview's Scroll Bar Wider??
joshuaand replied to joshuaand's topic in Windows Forms
I dont want to set the width for every scrollbar in windows, just the one listview. -
Hi, Ok I have a listview in details view, witha bunch of stuff. This will be used with a touchscreen so the font is quite large, but the scrollbar is the same size no matter what font, I need to make it wider so it is easier to use. Anyone have any ideas???
-
Reize JPEG Image WITHOUT compresssing it??
joshuaand replied to joshuaand's topic in Graphics and Multimedia
reply hi, I understand this, but when I use the encoder I can save it without loss of file size, but I cannot modify the size using this, thats the only thing extra I want to do, "some loss" is acceptable, but making a 120kb file 27kb when there has been no decrease in dimensions is not ok. -
Reize JPEG Image WITHOUT compresssing it??
joshuaand replied to joshuaand's topic in Graphics and Multimedia
Compresssion Hi, When the file is smaller, there should be some reduction in size, however as I said in my explanation, I am resizing a 640x480 image to 640x480, then saving it, and it decreases in size, which it shouldnt? Not by 75% anyways. -
Hi, Ok I have an image, that is out of proportion to what I want. I want to resize that image, WITHOUT compressing it again, losing file size. Currently when I do this: Dim oImg As Image = Image.FromFile("C:\sourcefile.jpg") Dim oThumbNail As Image = New Bitmap(640, 480, oImg.PixelFormat) Dim oGraphic As Graphics = Graphics.FromImage(oThumbNail) oGraphic.CompositingMode = Drawing2D.CompositingMode.SourceOver oGraphic.CompositingQuality = Drawing2D.CompositingQuality.HighQuality oGraphic.SmoothingMode = Drawing2D.SmoothingMode.HighQuality oGraphic.InterpolationMode = Drawing2D.InterpolationMode.Bicubic oGraphic.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality Dim oRectangle As Rectangle = New Rectangle(0, 0, 640, 480) oGraphic.DrawImage(oImg, oRectangle) oThumbNail.Save("C:\test.jpg", Imaging.ImageFormat.Jpeg) The image seems to look the same but it compresses it. When I run that over an image that is already a 640x480 jpeg, @ 126 KB, it reduces it to 36KB So I wasnt happy with that and did this: Dim myImageCodecInfo As Imaging.ImageCodecInfo Dim myEncoder As Imaging.Encoder Dim myEncoderParameter As Imaging.EncoderParameter Dim myEncoderParameters As Imaging.EncoderParameters myImageCodecInfo = GetEncoderInfo("image/jpeg") myEncoder = Imaging.Encoder.Compression myEncoderParameters = New Imaging.EncoderParameters(1) myEncoderParameter = New Imaging.EncoderParameter(myEncoder, Imaging.EncoderValue.CompressionNone) myEncoderParameters.Param(0) = myEncoderParameter Dim saveImage As Image = Image.FromFile("C:\sourcefile.jpg") saveImage.Save("C:\test.jpg", myImageCodecInfo, myEncoderParameters) So when I do this, it spits out an image about the same size, generally a little bigger, thats great, but I cant work resizing into that without it ignoring the encoder stuff and giving me a tiny little file again. Any help is appreciated!!!!!!!!!!!!!!!!!!! Thanks Joshua
-
Thanks! Thanks for that, I still have a bit of learning to do then hey! I appreciate your help! Thanks Joshua
-
Figured It Out Hi, I figured it out, I needed: <%@ Import Namespace="KIF.KIF" %> instead of: <%@ Import Namespace="KIF" %> Is there anyway to remove the project name from the reference? thanks josh
-
I Give Up! Hi, I still cant get it working, I have looked at other sites and this is what I currently have: MY class Module: (Created with visual studio as a Class Library, project called KIF., compiled to dll, and dll placed in bin directory on webserver) Imports System Imports System.Data.SqlClient Namespace KIF Public Class commonFunc Public Shared gDBConn As New System.Data.SqlClient.SqlConnection Public Shared Sub createDBConnection(ByVal ConnSTR As String) Try gDBConn.ConnectionString = ConnSTR Catch ex As Exception End Try End Sub End Class End Namespace This is the aspx page: <%@ Import Namespace="KIF" %> <script runat="server" language="vbscript"> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim CommonFunctions as New commonFunc CommonFunctions.createDBConnection("connstr") end Sub </script> <html> <head> <title>Untitled</title> </head> <body> test </body> </html> I Get The error "Type 'commonFunc' is not defined." ????????????????????????????????????????
-
Thanks Hi, Thanks for the reply, I pretty much thought thats what I had to do, how do I include that dll into the page though? Thanks Joshua
-
Coe Library Hi, All I want is to include custom functions and subs into a common file, then share these between pages, they will include no user interface, just some functions like database calls, common mathematical routines etc. Not quite sute on the approach, I have strong .NET skills, just not around ASP.NET. Any Help is appreciated. ------------------------------------------------------------------------- Ok This is what I want to do for example: include these three functions (IN A SEPERATE FILE): public function getCheckbox() Dim theCheck as string theCheck = "<input type=""checkbox"" name=""test"" value="""">Test" return theCheck end function public function getRadioButton() Dim theCheck as string theCheck = "<input type=""radio"" name=""test"" value=""1"">Test 1" return theCheck end function Then On my ASPX page call it like: <html> <head> <title>Untitled</title> </head> <body> <Form> Check: <%=getCheckbox()%> Radio: <%=getRadioButton()%> </form> </body> </html> Any Help is appreciated! Thanks Josh
-
HI, Ok I think this is a stupid question but I will ask anyways. In Previos versions of ASP, Ihave always used the <include statement to include files, mainly these files were code libraries, files like all my database functions, etc. So I want to do this in ASP.NET, all the files will be are code libraries, functions and subs that I will add and use in each page. My question is how do I achieve this? I read about the acsx extension was of including, but this creates a usercontrol, not what I want? Do I have to compile a DLL to get this to work? If so how? Thankyou very much You Help is Appreciated Joshua
-
thanks thanks, looks like it will do the trick, will check it out when I get a chance! thanks josh
-
Not What I want to Do That is NOT what I want to do.
-
Hi, Ok what I want to do is to login to a newtwork share so I can pass files back forth without having to browse to it manually first and login to the share. Anyone Have any ideas on how to do this? Thanks Joshua
-
is there any way to do it, API?
-
Hi, I have changed my form's background color, to a blue, and I have a mainmenu item on the form, but the menu still stays grey. I am using the ownerpaint and DrawItem to draw a background color for each menu item, but the background of the menu still stays grey? any ideas? Thanks Josh
-
I mean 3000 lines!
-
how much code do you want, there is about 300 lines of it?