|
CSV means "Comma Seperated Values". It's a text file, which you can esaily open in Notepad to view. It may be possible to do, but your application is the only one that's going to be able to read it. Noone puts images into a text file because it's a very inefficient way to represent the data that makes up an image.
|
|
|
|
|
I created a collection for a combo box in the designer, but I need to assign numeric values to the collection so that I can compare them to the database for use in an Update statement.
How can I do this?
Should I create an array and assign the array to the collection instead?
Will using an array slow the program down?
|
|
|
|
|
AAGTHosting wrote: I created a collection for a combo box in the designer,
OK. Where is the data comming from that populates this "collection"?? Or are you talking about a DataSet instead?? If the data is comming from a database, then you have to return not only the item descriptions from your table, but also the primary key field for those items. Your table might be something like:
Id Description
--- ----------------
0 Blue
1 Black
2 Red
3 Green
You need to return both columns so that you can tell the ComboBox's DisplayMember property to show the Description field and it's ValueMember to point to the Id field. When the user picks one of the colors from the ComboBox, it'll return the ValueMember instead (the Id of the Description, not the Description itself).
AAGTHosting wrote: Should I create an array and assign the array to the collection instead?
Nope. Completely pointless and duplicates effort and possible data, depending on how you do it.
AAGTHosting wrote: Will using an array slow the program down?
No. But needlessly dupicating data will.
|
|
|
|
|
I was going to store the data for the collection in the designer itself, although I do have a database table that holds the days of the week as well. Maybe I should populate the cobmo box from the database. All I need to do is update the database with changes in the sechdule from and to times in the database.
|
|
|
|
|
AAGTHosting wrote: I was going to store the data for the collection in the designer itself
Since the designer only generates code from a visual representation of an idea, you can't store data in the designer.
AAGTHosting wrote: Maybe I should populate the cobmo box from the database. All I need to do is update the database with changes in the sechdule from and to times in the database.
If the data populating the ComboBox is directly related to data in the database, yes, this would be the best idea.
|
|
|
|
|
I'm new to application, I would like to read a step-by-step article teaching me how to create a role-base win-application (using defined users and passwords, not windows's).
thanks
Shimi
|
|
|
|
|
There's a bunch of different ways of doing this. You can start by reading these[^].
But, if you're new to programming, let alone any experience with the .NET Framework, something like this could be way over your head.
|
|
|
|
|
thanks for your post,
I want to develop an application for many users and keep their information in a SQL server table, I just don't know how you make the entire application respond when a user has been switched.
Shimi
|
|
|
|
|
You'll probably need a User object you create that keeps track of the user roles. All of you application code will have to keep referring back this object to check if the user has the appropriate permissions to run code and setup the user interface appropriately.
Here's[^] a another view of the subject.
You're looking for a simple answer to a very large and complex problem. There is no single step-by-step guide that's going to show you how to do this, let alone explain how and why it works. The solutions involve knowing about various design patterns and how they interact with each other. This topic alone can fill over a 1000 pages.
|
|
|
|
|
|
I am working on a database application by using VB.Net and a COM Addin to integrate my application with Outlook 2003.
- I am calling an 'Outlook New Message window' from a VB.Net form.
- On Email ItemSend event I am updating the database by using a COM Addin.
- When I get focus back to my VB.Net application, I want to refresh current form with updated data.
Can anyone guide me how to call a function of application A from application B which refresh/reload a form in application A without restarting the application.
I have tried System.Diagnostics.Process but it doesn't seem working.
I would appreciate a quick response.
Nas
|
|
|
|
|
manisghouri wrote: When I get focus back to my VB.Net application, I want to refresh current form with updated data.
If I understand the problem correctly, all you have to do is the same thing that you did before to get the data you're already showing. DOing it again will perform the same query, updating what you got from the database with the changes you just made.
Your description isn't very clear about what you're doing, what form is showing what data, where that data is comming from, what the business process is, ...
|
|
|
|
|
Thanks for your reply. Let me be more specific to my problem.
I am working on a Customer management system which comprises of two applications.
Application 1 (customer management) is a windows application and based on VB.net and SQL Server 2000.
Application 2 is a COM Addin for Outlook 2003 and written in VB.net
-When an user select/open a customer form (in App 1), I display customer information on the form inlcuding recent emails summary in a grid.
-When user select an option 'New Email', I call Outlook New message window from App 1. On ItemSent event in Outlook I am saving email data ( email address, date, subject, email body and attachments) in customer database By using a COM Addin (This is done in App 2).
-As soon as email is sent and email message has been saved in database, application 2 terminates itself and Application 1 gets focus on currenltly loaded customer form. At this time I want to show recently sent email data on the form in email summary grid.
I hope it will give you a better understanding about my problem.
I will appreciate your support.
Nas
|
|
|
|
|
manisghouri wrote: When an user select/open a customer form (in App 1), I display customer information on the form inlcuding recent emails summary in a grid.
Repeat this step after the COM object is closed.
Now detecting when the COM object closes may be the real issue, hopefully dave will help there!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You're going to have to implements some remote call to tell App A to refresh itself. You can do this either using .NET Remoting (deprecated after .NET 2.0) or Windows Communication Foundation (.NET 3.0 and above).
|
|
|
|
|
Not sure if I'm heading in the right direction but I have an application that when minimized it goes into the system tray, but then when the user double clicks the the application icon a second time it opens another instance of the application I would like it to activate the instance already running in the system tray. I can use Process.GetProcesses() to find if the process is currently running, but not sure what comes next I will list below what I have got so far... This application requires the user to login so I use a sub main to login then run app and when not used it is minimized don't want users logging in multiple instance...
Any help would be Greatly Appreciated
VB.net VS2005
---------------------------
Public Sub Main()
Dim localAll As Process() = Process.GetProcesses()
Dim x As Integer
For x = 0 To localAll.Length - 1
If InStr(localAll(x).ToString, "MyApp") Then
'Activate the running app ' <-- Need Help Here
Else
Dim dlg As New LoginForm1
If dlg.ShowDialog() = DialogResult.OK Then
Application.Run(Form1)
End If
End If
Next
End Sub
dotnetme2
|
|
|
|
|
For a single instance app, all you have to do is Enable the Application Framework in your "My Project" item in the Solution Explorer.
What do you mean by "Activate"?? Are you trying to show the main form of your app?? EXACTLY how is this form hidden from the user??
|
|
|
|
|
What I mean by activate is basically maximize the application in the system tray rather then start a new instance...
Thanks for the tip But.... if I check the "Enabled application framework" check box in "My Project" it says that I must use a "Form" as my "Startup object" and I have "Sub Main" in Module as my startup so I had to uncheck it. I'm sure there is another way to launch "sub main" but I not sure just how to do it...
Is there another to either make it a single instance??? The reason I used a module was instead of a form was so I can call the login form have the user login then close the login form and launch the main form of the app.
Thanks for any help...
dotnetme2
|
|
|
|
|
dotnetme2 wrote: Is there another to either make it a single instance???
It's been discussed and rehashed countless times for years. All you have to do is Google for "VB.NET single instance application". Here's[^] a good one, since it even has the "show main window" functionality you were looking for.
|
|
|
|
|
Perfect Thanks...
dotnetme2
|
|
|
|
|
Forgive me please if this is the wrong place but it is probably a VB question.
I need to know if it is possible to create a macro in VB under Excel so that under a push of a button a new worksheet can be created and named after the contents of a cell.
That is, one would insert a name into a cell and hit a "Create New Sheet" button link to a macro that would do it.
I have tried looking at the manuals and the help screens, but my knowledge of VB is weak, and although my Excel isn't bad, it is not something I have had a requirement to do before.
If it is at all possible I would be immensely grateful!
------------------------------------
I try to appear cooler,
by calling him Euler.
|
|
|
|
|
Sure. It would probably look something like:
Dim newSheet As Worksheet
Set newSheet = Sheets.Add()
newSheet.Name = Sheet1.Range("someCellAddress").Value
|
|
|
|
|
Thanks for that, I shall go and check it out!
(It may make it look as though I know what I am on about )
I knew it was possible, but for the life of me I couldn't figure it out.
Thanks
------------------------------------
I try to appear cooler,
by calling him Euler.
|
|
|
|
|
I currently have a program that loads window forms. How do I change this program if I don't want the forms to show. How do I change my program to run from a sub main procedure? My Reason: My program communicates with a 3rd party device. Currently I can run my programs in windows and interact with it. But, on another project my program can be used for communicating but does not need to be viewed. I want to have my program run in the background (still doing the communicating). What is the best way of doing this? I would like to set a property. When this property is check the program runs as a stand alone program. When not checked I see all windows forms.
|
|
|
|
|
Put a Sub Main in either a module or your current startup form. In this code, chekc the command line parameters to see if an option that you define is there, telling the code how to launch itself.
You'll probably have to reorganize your code, seperating the work classes from the form code (User Interface code). All of the work code should have nothing to do with updating controls, getting input from the user, nothing. It should be able to run completely on its own without any UI concerns whatsoever.
A Sub Main would looks something like:
Public Class Form1
Inherits System.Windows.Forms.Form
Private RunUnattended As Boolean = False
<STAThread()> _
Shared Sub Main(ByVal cmdArgs() As String)
For Each cmd As String In cmdArgs
If cmd = "myOption" Then
RunUnattended = True
End If
Next
If RunUnattended Then
' Run your work code here...
Else
Application.Run(New Form1)
End If
...
|
|
|
|