|
Sir,
I have a program containing more then 35 textboxes and have 2 pages .Can you please send me code for checking the preview of the page and finally printing the page.
Thanks and regards
Amaneet Brar
|
|
|
|
|
how to read data from excel file and to push data to sql server
|
|
|
|
|
|
|
To read data fro an excel file use the following I posted earlier (Sory dont know how to put a link in to that post)
Right click on References in the solutions explorer and select add reference.
Click on the COM tab and scroll down until you find "Microsoft Excel Object library". if there are a couple selcet the highest version. This will create a reference to the Excel library.
In your code create some variables below:-
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Create a variable that hold the path of the spreadsheet you want to open (xlFile)
Set the xl Variables
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Open(xlfile), Excel.Workbook)
xlSheet = CType(xlBook.Worksheets([Enter the worksheet name or index]), Excel.Worksheet)
This will create the xlspreadsheet in the background.
You could then populate your dataset etc by interating through the rows and columns by
myVar = xlSheet.Cells(rowIndex, colIndex).Value
then you can send the data to the SQL server.
Hope this helps
The FoZ
|
|
|
|
|
how can i implement birthday remainder
|
|
|
|
|
|
I have a application that does not seem to release memory after opening and closing a new screen. A screen is just usercontrols loaded into a panels. There is a manager to handle this that is rather complex and since I did not write the application I am having a hard time figuring out where to look. In task manager my memory usage for the exe goes from 40 to 100 meg in no time almost 5 meg for every open screen but when they close it does not release the memory.
Does anyone have or know of a tool or technic that I can use to track this down or how I can go about looking for the problem.
Thanks
Joe
-- modified at 9:35 Friday 9th June, 2006
|
|
|
|
|
You can look for a profiler that will show you (among other things) what kind of classes it is that is allocated in the heap.
When controls are used in a form, the form takes care of calling the Dispose method of the controls. If you add and remove controls yourself, you have to call the Dispose method yourself when removing them.
---
b { font-weight: normal; }
|
|
|
|
|
Task Manager is the worst place you can look to see how much memory your app is using. What you're actually seeing is how much memory the virtual machine (.NET CLR) is both using and has reserved for your application. Even though it looks like your app is being a memory hog, it's not. The memory you see as being "used" is actually being reserved, held in the Managed Heap, for future allocations by your application.
Use the Performance Monitor and the .NET Memory counters, or some other profiling tool, to see how much memory your app is actually using.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What is the affect on the system if that number continues to grow. Like you said it is reserved but doesn't that have the same kind of problem as memory usage, if it keeps taking up the reservations on the heap.
I downloaded ANTS Profiler (trial version) and trying to look at it this way. initially it looks the same ( using memory up ) but I need to use the tool more so I can understand what I am looking at better.
Thanks Dave.
|
|
|
|
|
The .NET CLR will hold onto the memory until either your application allocates more objects or Windows wants memory. In the later case, the CLR will release blocks of memory back to the system until Windows in happy. The .NET Garbage Collector does a really good job of managing memory for you.
Now, that doesn't mean that your app isn't allocating objects and not releasing them! That's where the Profiler comes in handy. It takes a bit of reading the documentation to figure out what you're looking at.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I wrote with VB.NET a service (with sample). It works perfect on the computer where I develop. I can install that service on another computer (with serviceInstaller), but after "net start" I get the error 2186 "Service is not responding to the control function". When I start it from the service windows I get the error 1053. What wrong? Or where can I find a full description of implementing and installing a service?
Thanks for you help
|
|
|
|
|
solution: Installing the .NET Framework
|
|
|
|
|
Hi there,
can anybody help me.....how to use the login control in vb.net 2005.....i mean dragging and dropping how to code it.
Thanks and Regards.
|
|
|
|
|
has any VB conversion tool use to convert VB to VB.NET easier...
Angela
|
|
|
|
|
Yeah, just open the old VB6 project in VB.NET and it'll automatically launch the conversion wizard. It is most definately NOT a perfect conversion. In most cases, I would recommend just rewriting the project from scratch or converting parts of the app and rewriting the remaining pieces of it. The conversion process does NOT take advantage of the true OOP capabilities of VB.NET, nor does it convert every object into an equivilent .NET BCL object.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I try the way to convert VB6 to VB.NET, it's works.
Thanks for your guideline and recommendation
angela
|
|
|
|
|
Hi,
how can we change the propertis of pdf files using the VB interface.By changing the properties i mean embedding the digital signature into the file,adding the watermark in the background,disabling the the file for printing,and other security features.All this is to be done using Visual Basic interface.
Plz help me with the code
Thanks
-- modified at 7:10 Friday 9th June, 2006
|
|
|
|
|
Since VB, or any other programming language, doesn't know anything about the format of a PDF file, you'll need some kind of 3rd party component to handle manipulating the .PDF file for you. I don't know of any specific components off the top of my head, but they do exist. Most notably Adobe would have the SDK tools you need. But I think their developer site is subscription based. Last I checked anyway...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have searched the SDK tool and have generated a code to change the property of the pdf files, but that code didn't worked. Sir can u plz give a line of action in term of how the code is to be written
kindly help me with one simple code (in vb)for just altering ne of one settings like enabling/disabling printin of a pdf document or adding water marks or ne other security settings...programmaticaly..
thanx!!
|
|
|
|
|
I've never touched Adobe's SDK and don't know anything about it. The best source of information would be Adobe's support.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
I need to run a VB.NET program on a server. What security policies do I need to set to run a program that uses a MySQL DB?
Also do you need to make a strong name or can you just set the all code condition?
Hope any one can help
Kris
|
|
|
|
|
There's really no difference between running your code on a Server version of Windows and a Workstation version. Setting security options would depend nearly entirely on what your application is doing and what resources you want it to have access to and under what user accounts. This is by no means trivial, meaning setting an option here and there. There is a bunch of planning that goes into this because there are just so many considerations - code access security, users rights to resources, database security, ... There's just too much to go into in a forum post.
You can start with the .NET Developers Guide and the section on Code Access Security[^].
And no, you don't HAVE to make a strong name for anything, but depending on your application and requirements, it might just be a good idea.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hello Dave,
I copied the directory to the server and tried to run it. But I get a security exception. The given exceptions are:
An unhandled exception of type 'System.Security.SecurityException' occurred in fichebeheer.exe
Additional information: Request failed.
Unhandled Exception: System.Security.SecurityException: Request failed.
at fichebeheer.Form1.InitializeComponent()
at fichebeheer.Form1..ctor()
at fichebeheer.Form1.Main()
The granted set of the failing assembly was:
PermissionSet class="System.Security.PermissionSet"
version="1">
IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e"
version="1"
Read="USERNAME"/>
Doesn't this mean I need to set some permissions?
Greetz Kris
|
|
|
|