|
Oh! oh!! I know! I know! ** Sticks hand high in the air** We should use parameterised queries! We should use them becuase it makes the application safe from people trying to inject into it!
|
|
|
|
|
Colin Angus Mackay wrote: Oh! oh!! I know! I know! ** Sticks hand high in the air**
Ah, yes! The Scottish guy in the back there...
Colin Angus Mackay wrote: We should use parameterised queries! We should use them becuase it makes the application safe from people trying to inject into it!
Very good! You get a Gold Star for the day!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Sounds nice but I am having trouble getting my parameterised query to work using MySQL. However, the code that I am currently using to insert is working fine now. Also, I found out why the empty rows are being inserted into the db. The file that I am cleaning is being cleaned and making the file double spaced. I could use a helping hand with this issue. Here is the code that I used to clean the file:
'Read file line by line
Dim file_name As String = "c:\Scanning files\lsprint_MO.txt"
Dim Temp_file As String = "c:\Scanning files\lsprint_MO_temp.txt"
Dim textline As String
If System.IO.File.Exists(file_name) = True Then
Dim objReader As New System.IO.StreamReader(file_name)
Do While objReader.Peek() <> "-1"
textline = String.Concat(objReader.ReadLine(), ControlChars.NewLine)
If textline.IndexOf("xxxxxxx") = 17 Then
Console.WriteLine(textline)
WriteFile(Temp_file, textline)
End If
Loop
objReader.Close()
My.Computer.FileSystem.DeleteFile(file_name)
End If
Any ideas would help!
|
|
|
|
|
jds1207 wrote: The file that I am cleaning is being cleaned and making the file double spaced.
It's called Validation and you're not doing anything to verify that what you're reading is valid. You're just assuming that what you have in your variables is good and that's why your database is comming up with zeros.
You're going about reading a text file the hard way.
Dim sourceFilename As String = "C:\Scanning files\lsprint_MO.txt"
Dim tempFilename As String = "C:\Scanning files\lsprint_MO_temp.txt"
Dim textline As String
If System.Io.File.Exists(sourceFilename) Then
Try
Dim sr As New StreamReader(sourceFilename)
Do
textline = sr.ReadLine()
' Why are you using String.Concat?? Your building a line and adding
' blank lines to the textline string. Why??
' Parse your line here and make sure that the values you got are VALID!
' If not, jump to some other method to report or log the problem.
' If we get here, the data looks good. Add it to the database.
' Call your database code here and pass the "cleaned" values to it.
Loop Until textline Is Nothing
Catch ex As Exception
' Something happened during the file read or database call.
' Log the error or report it somehow and forget the rest of the file.
Finally
If Not sr Is Nothing Then
sr.Close()
End If
End Try
It would also help to see a sample of the file you're trying to read and parse.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks! That worked fine.
|
|
|
|
|
Hi All,
Can anyone please tell me what does the Err.LastDllError() return?
|
|
|
|
|
|
What does the Err.LastDllError return?
|
|
|
|
|
hellow m making my project for Classes which stores student's personal, Fees ,Marks details.In this when staff membe checks for student's fees it should display it in balance amount ,Paid amount,and fees for the course.then when he checks for student's marks details all the marks should be displayed along with graphical view...
Glad to join you. Want you to help me.Mayuri
|
|
|
|
|
Mayuri Gaikwad wrote: Want you to help me.
With what? You haven't asked a question yet...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Sir,
I am converting a ActiveX(DSO Framer)control into .Net assembly.
1. I was able to import it as assembly using "Tlbimp" utility,
2. I could able to convert the content in to Intermediate Language form by using utility "Ildasm" utility. But
3. When I tried to edit the content for verification by using the utility "Ilasm" its giving error as below
Errors /* No entry point declared for executable
Could not create output file, error code=0x80004005
***** FAILURE *****
Please give me what to do now. Please.
and
Creating PE file
Error: No entry point declared for executable
Could not create output file, error code=0x80004005
***** FAILURE *****
*/
Please check these errors and give me a good solution please, I am struck here please. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: I am converting a ActiveX(DSO Framer)control into .Net assembly.
Not possible unless you write all the code yourself.
indian143 wrote: 1. I was able to import it as assembly using "Tlbimp" utility,
No, you were able to have TlbImp create a wrapper assembly around your ActiveX component. This means that you still have to install both the DSOFramer control AND the .NET wrapper class you just made on the clients machine. So, you didn't take away the installation requirements, you actually added to it.
indian143 wrote: 2. I could able to convert the content in to Intermediate Language form by using utility "Ildasm" utility. But
Not possible since this control wasn't written in any managed language. You can use this tool to see the IL code in the wrapper, not the control it wraps.
indian143 wrote: 3. When I tried to edit the content for verification by using the utility "Ilasm" its giving error as below
What you're trying to do is not possible. We've already told you half a dozen times, you either have to write a replacement control from scratch or find a replacement control that offers the functionality you want. You can NOT convert this control to a .NET assembly, you can only wrap it in one.
-- modified at 11:55 Thursday 11th January, 2007
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
it's a small thing but it's bad problem ,,
I'm using vb.net 2005 , when I go to run the project from the design mode it's OK , but when I go to run the EXE of the project , I found that the splash screen is appearing and then the StartUp form is running behinde other windows openning programs ,
this problem isn't appear when I run the program from it's source on vb.net envirnment , but on Exe , it's appear .....
any body response me quickly please ??
jooooo
|
|
|
|
|
I had this problem too, although it happened for me both when I ran the project through vb and when I ran the exe. I solved it like this:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'Hide the form while splash screen is visible<br />
Me.Hide()<br />
<br />
'Insert your form loading code...<br />
<br />
'Reveal the form when loading is complete<br />
Me.Show()<br />
End Sub
Hope this helps.
|
|
|
|
|
Thanks my friend , but the problem wasn't solved ,
Now for a period I will cancel splash screen until I can find any thing else
jooooo
|
|
|
|
|
since you are using vb.net..you could set the properties to topmost = true
or in the form load...
Me.TopMost = True where me is the name of the form..hope this help for you..
|
|
|
|
|
|
Hi,
I want to get into programming using Visual Basic / VB.NET.
Would appreciate any technical material, papers and tutorials to help me get started well.
I would appreciate any easy to follow video or tutorials to help me get into the VB programming world.
Thank you.
Emmanuel Awortwi
emmanuelawortwi@yahoo.com
+233-24-4951875
|
|
|
|
|
Hi Emmanuel,
First off it is best to only bother with VB.NET (VB6 = old). The best tool is Microsoft's .NET Studio. If you can obtain it, it contains its own documentation with step-by-step walkthroughs for all kinds of operations. With these walkthroughs you can create simple projects that you can then experiment with and expand.
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
When I tried to edit the .il file it is giving the following error.
No entry point declared for executable
Could not create output file, error code=0x80004005
***** FAILURE *****
Please give me what to do now. Please.
C:\WINNT\Microsoft.NET\Framework\v1.1.4322>ilasm D:\Aleem\DSOControl1\DSOControl1.il
Microsoft (R) .NET Framework IL Assembler. Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Assembling 'D:\Aleem\DSOControl1\DSOControl1.il' , no listing file, to EXE --> 'D:\Aleem\DSOControl1\DSOControl1.EXE'
Source file is ANSI
Creating PE file
Error: No entry point declared for executable
Could not create output file, error code=0x80004005
***** FAILURE *****
C:\WINNT\Microsoft.NET\Framework\v1.1.4322>
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Hi,
I would like to know how to get the item being selected by the user from the popup menu which occurs when the user right clicks anywhere in the desktop or for eg if a slide show is running then how to get which menu item is been selected by the user from the menu which appears when he right clicks?
Plzzzzzz help me in this....;)
badhris
|
|
|
|
|
The actual control that you are talking about is not called a popup menu, it is called a ContextMenuStrip control. It works just like a MenuStrip control. Each item on the ContextMenuStrip is a ToolStripMenuItem and you can program the click event for each one. You should be able to find more information or help on the subject if you actually search for "ContextMenu".
Hope this helps.
|
|
|
|
|
Dear sir,
I have done the assembly registration and gac intallation in two steps, but I am getting error as
* Failure adding assembly to the cache: An attempt was made to load a program with an incorrect format. *.
Please tell me what could be the reason, and where I might have done mistake. The steps I did are as below.
No. 1 C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin>sn -p D:\Aleem\DSOControl1\DSOControl1.snk
D:\Aleem\DSOControl1\DSOControl1.dll
Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Public key written to D:\Aleem\DSOControl1\DSOControl1.dll
No. 2. C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin>gacutil /i D:\Aleem\DSOControl1\DSOControl1.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Failure adding assembly to the cache: An attempt was made to load a program with an incorrect format.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
I have a large project (800 000 lines) in VB6 which I am attemting to convert to .NET. This project does a considerable amount of asynchronous processing, requiring the called activeX module to call back to the calling activeX upon completion of a task, or to signal that an event has taken place.
This was easy in VB6: simply pass the activeX object to the called program as an initial parameter. Subsequent return calls are made to this object.
Surely there must be a simple way to achieve this same goal in .NET? I have spent days experimenting without success.
I cannot believe that Microsoft have taken a simple, elegant and practical language like VB6 and turned into an exercise in obscure, abstract computer science!
Eldie
|
|
|
|
|
How to Convert HTML to MSAccess using VB6.0
Please Help
is it possible to convert HTML to MSAccess(mdb) using VB?
if so please help me with VB Code
Programmer
|
|
|
|