|
Hi And Thanks!
Works perfectly!
Thanks Again!
MrWolfy
|
|
|
|
|
I want a grid control for a Windows Forms Project that will take a DataTable and display it vertically. For example it would take a DataTable like this:
Name Amount Due
Bob 55.65
Sue 20.33
Fred 15.18
And then display it like this:
Name Bob Sue Fred
Amount Due 55.65 20.33 15.18
I know I can get basically the same result by just flipping rows/columns in the DataTable, but I'm guessing that with very large DataTables this would not be very efficient. And I may need to use very large DataTables.
So, does anyone know of a good article of how to get started creating a control that would do this or something similar, or of a control out there that already does this? I've found some info on web versions of a grid that does this, but I've had a hard time finding anything that is specifically for a Windows Forms project. Any help would be appreciated.
|
|
|
|
|
I created a stored procedure which worked fine on Query Analyzer, except I had to load my text file locally on my "server", using this command [EXEC OrderImport 'C:\Import.txt']. Here are the problems:
1. How can I tell my stored procedure to look for my "text file" in the client, not the server?
2. On my VB codes, I have a "text box" (Txt_Path.Text) to enter the "File Path" and when I execute the stored-procedure, this file path should be included. How can I code it correctly in VB? Please look at this statement if I did it wrong "Cmd.Parameters.Append Cmd.CreateParameter("File_Path", adVarChar, adParamInput, 6, FilePath)"
Thank you again for your help.
*******This is my Stored Procedure********
CREATE PROCEDURE OrderImport
@PathFileName varchar(100) --this is my parameter for the file path
AS
DECLARE @SQL varchar(2000)
BEGIN
SET @SQL = "BULK INSERT TmpDeck_Ord FROM '"+@PathFileName+"' WITH (FIELDTERMINATOR = ',') "
END
EXEC (@SQL)
INSERT Deck_Ord (Depot_Num,Wty_Status,Ros_Num )
select Depot_Num, Wty_Status, Ros_Num
FROM tmpDeck_Ord
TRUNCATE TABLE TmpDeck_Ord
GO
******and this is my VB codes********************
Option Explicit
Dim Con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim Cmd As ADODB.Command
Dim FilePath, StrConnect As String
Private Sub Cmd_get_Click()
FilePath = Txt_Path.Text
Set Cmd = New ADODB.Command
Cmd.ActiveConnection = Con
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "OrderImport"
Cmd.Parameters.Append Cmd.CreateParameter("File_Path", adVarChar, adParamInput, 6, FilePath)
Set rs = Cmd.Execute
Set Cmd.ActiveConnection = Nothing
End Sub
Private Sub Form_Load()
StrConnect = "Database=myDB;SERVER=myServer;DRIVER={SQL SERVER};"
Con.Open StrConnect, "sa", "password"
End Sub
PNH
|
|
|
|
|
phn110 wrote: 1. How can I tell my stored procedure to look for my "text file" in the client, not the server?
You can't. The server's SQL accounts are not going to have any permissions to the filesystem of the local workstation.
|
|
|
|
|
Dave, thank you for your reply.
How can I work around that with VB app.? I used a "FilePath" as a parameter in the stored procedure. Thanks in advance for your help.
PNH
PNH
|
|
|
|
|
If this is storing the contents of the file in a column of a table, you send the file contents, not the file path.
Google for "VB.NET SQL database image" for examples. It doesn't matter what type of file is involved. The technique is the same.
|
|
|
|
|
Whenever I try to connect to visual source safe database i get an error message "Access is denied for rights.dat from the network computer", even though the full rights has been given for the shared folder where the database is located.
Please help
|
|
|
|
|
Hi,
To resolve this problem, build a new Um.dat file. Note that when you build a new Um.dat file, you must add all of the users again.
1. To build a new Um.dat file, follow these steps: 1. Create a temporary folder named C:\Sstemp.
2. Click Start, click Run, type cmd, and then click OK.
3. Go to the VSS\Win32 folder in the command prompt window, and then type the following command:
mkss c:\sstemp
4. In the VSS\Win32 folder at the command prompt, type the following command:
ddconv c:\sstemp
5. In the VSS\Win32 folder at the command prompt, type the following command:
ddupd c:\sstemp
6. Copy the Um.dat file from the C:\SStemp\Data folder to the Visual SourceSafe data directory.
7. Rename the Rights.dat file in the Visual SourceSafe data directory as Rights2.dat.
8. At a command prompt, run the analyze -f command against the database.
9. Add all of the Visual SourceSafe users again.
10. Reassign rights to the Visual SourceSafe users.
Hope this would fix the issue: ).
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
In my company we've got a fairly old VB6 application (roots go back to 1998, VB6, DAO, Paradox). About two years ago, we added some import / export functions. We used VB.Net and Ado.Net. Works like a charm in countries with Western European charsets.
Now these import / export functions were requested in Russia. Now here is trouble:
- most Cyrillic letters are above ASC 128
- DAO 3.5 uses mspdox35.dll to read and write Paradox Data
- Ado.net uses the BDE if installed (via mspbde40.dll)
- the way mspdox35.dll and BDE store and retrieve character data with codes above 127 is incompatible.
Here is what I tried so far:
(1) Changed the Paradox Table Language from "Paradox 'intl'" to "Pdox ANSI Cyrillic". Data read and write for Ado.net (via mspbde40.dll and BDE) is okay, but I can't access those tables with DAO (Exception 3274, External table isn't in the expected format).
(2) Forced mspbde40.dll to read and write the data itself (HKLM\SOFTWARE\Microsoft\Jet\4.0\Engines\Paradox BDE = 0x2 (REG_DWORD)). The characters are OK but the performance is unacceptable (Insert of 255 records takes ~ 50 seconds! For comparison: via BDE the same code runs in about 20 seconds).
Other things I tried which didn't show any effect:
- Changed the Paradox LangDriver in the BDE Administrator
- Used the OleDb*-classes instead of the Odbc*-classes
For the heck of it I wrote a routine in VB.NET using DAO. Works and is bindingly fast (< 1 second!). Now what should I do?
(a) rewrite all data access routines to use DAO? Since the import / export is fairly complex this would take a week or so.
(b) write a custom DataProvider (implementing IDbConnection, IDbCommand, etc.) bridging to DAO? Has anybody already done that?
(c) Find the switch that makes mspbde40.dll's own Paradox routines so awfully slow. My suspicion: tables can't be locked exclusively. Also bulk updates (UpdateBatchSize > 1) aren't supported by mspbde40.dll.
(d) ??? Any hint is welcome!
Regards
Martin
|
|
|
|
|
Don't go back to DAO. It's a dead technology and hasn't been supported for years.
It still exists in Windows though, so you can write a utility to convert and upgrade the database. Use the old DAO technology to read your old database, then write the upgraded database with ADO.NET.
|
|
|
|
|
Hi Dave!
Thanks for the answer. To convert the whole application to ADO.NET is not an option, though. The application is near the end of it's life cycle and we won't invest months to switch to current data access technology.
All I want is that my .NET import / export library stores and retrieves character data in a DAO compatible way - with acceptable performance.
Regards
Martin
|
|
|
|
|
If this is just a small request, then you can still use the DAO technology to do this. There's nothing wrong with that. I just wouldn't like to see you dump all kinds of time into new development, or an app that's still has a pretty lengthy life still in it, just to see DAO disappear from the next release of Windows or get ripped out by some service pack or patch.
|
|
|
|
|
|
pavanip wrote: I am developing one application like Anti spyware
pavanip wrote: And what is adware,Trojans, Malware, Keylogger.
If you don't know what this is, you don't have the slightest bit of hope of writing this. It's not just know what these things are, it's also knowing how these things work, how they hide themselves, what clues you're looking for to find these things, how you're search engine is going to work, how you're going to store the information you need to find these apps, ...
In order to write an application like this, you're going to need forensic-level knowledge of how these apps work and how Windows works. And here you're asking how to do something as simple as reading the registry?? I hate to rain on your parade, but your skillset isn't advanced enough to even attempt this app, yet.
|
|
|
|
|
I got various suggestion , But My problem is not solved yet..
I put my .exe file and .dll files in the application directory.
when I start my application it runs fine.
But, Somehow the .dll file is deleted from appliaction directory, then the application throw me a exception
Remember, that I can't check at the start of the application that the .dll file is exist or not, because, the .dll files is referenced at design time. Some controls are created with this dll.
So, How can I solve this problem?
|
|
|
|
|
pdnet wrote: I put my .exe file and .dll files in the application directory.
when I start my application it runs fine.
But, Somehow the .dll file is deleted from appliaction directory, then the application throw me a exception
Remember, that I can't check at the start of the application that the .dll file is exist or not, because, the .dll files is referenced at design time. Some controls are created with this dll.
Maybe you can make a "starter" application that does the checking and then launches the main application only if everything is as it should be.
|
|
|
|
|
|
pdnet wrote: I put my .exe file and .dll files in the application directory.
Are you talking about some folder under Program Files?
pdnet wrote: But, Somehow the .dll file is deleted from appliaction directory
This would only happen if your code was written to delete some files in the app's directory. Perhaps you're doing something with the CurrentDirecty and you don't realize it??
pdnet wrote: Remember, that I can't check at the start of the application that the .dll file is exist or not, because, the .dll files is referenced at design time
You should never have to do this. So what if the .DLL is missing at runtime?? If it's missing, what are you going to do about it?? Stop wasting your time trying to catch the "error" of a missing .DLL and start looking for why the .DLL is getting deleted, or moved.
|
|
|
|
|
I am using Vb.net 3.5
suppose I am using "nsoftware.IPWorksSSL.dll", Which is Store in application Directory.
In my code I am writing such as..
at MdiForm.Designer.vb
Me.Xmpp1 = New nsoftware.IPWorksSSL.Xmpps(Me.components)
When The dll file is missing from the application Directory it give me a error message
"The 'nsoftware.IPWorksSSL.dll' file is not defined"
So, How can I Check in my code that the dll file is exist or not. remember it is declared at the design time.
Please, Help me..
|
|
|
|
|
Uhhh...It sounds like you have a misconception about what design-time really is. From your description, you're not creating an instance of this control at design time. You're doing it runtime, and expecting things to happen that don't work the way you think it does.
You cannot just specify the name of a .DLL file in your code and expect it to be loaded into your app. You have to add a reference to this .DLL at design-time. The IDE will import the namespaces from this .DLL so you can use the classes in it. When you compile the app, the references will be resolved by the compiler and the appropriate .DLL files copied to the Release or Debug folders. You shouldn't have to do anything like your code snippet is suggesting.
|
|
|
|
|
What about setting the .DLL file to be a read only. This way, you may be able to determining who/what is deleting the file.
|
|
|
|
|
I wanted to implement 2 layers in a picture box by using picture box background image and image property.
I am able to do it when I am drawing some lines at run time on picturebox image and having a picturebox back ground image.
But when i save the picture box image (with transparent back ground) as .gif i get a black background.
Can any one plz help me with ho to save the image with transparent back ground
I am using the following codes
Dim ms As MemoryStream = New MemoryStream()
'Get the inmage into ms from picture box
picDraw.Image.Save(ms, picDraw.Image.RawFormat.Gif)
I am keeping the image in a memory stream so that i can send the stream to DB
Regards
Nishkarsh
|
|
|
|
|
nishkarsh_k wrote: I wanted to implement 2 layers in a picture box by using picture box background image and image property.
No such thing when using a PictureBox control. There's a Background image and the Image properties you can set, neither has anything to do with the other.
nishkarsh_k wrote: But when i save the picture box image (with transparent back ground) as .gif i get a black background.
Of course. The background image is not part of the Image property at all, so it doesn't get saved with the Image you save.
Your solution would be to create a new Bitmap object, draw the background image to it, then draw the foreground image on top of it. Then you'll have your composited image that you can save.
|
|
|
|
|
I think i need to re-frame my issue...
I am having a application which is similar to paint brush. Now when i am using a background image in the picture box and put another bitmap as picturebox image (bitmap is created in codes) with a transparent background it works perfectly the way i want.. I am able to do drawing (like mspaint) over the background... which are actually drawn in the picturebox.image not on picturebox.backgroundimage
Now the objective is to save the memory bitmap with the transparent background (which is displayed there in picturebox.image and available in memory bitmap) and display it when required (with transparent back), but when i save it the background becomes black
Any idea of how to save a image with transparent background..
Note: I am using GIF format to save the image, as per my knowledge we can have transparent background in gif
|
|
|
|
|
OK, now I get what you're talking about. Saving a GIF with transparency is not as easy as it should be. Read this[^].
|
|
|
|
|