Thanks however I'd prefer more basic onces than these. I'd also prefer NOT to get a second mortgage on the house for a few images. Surely there are some basic icons / collections we can download for free......
Mark Cabbage
Posts
-
Icons and Images for VB forms -
Icons and Images for VB formsHi everyone, I am after a nice collection of icons / images to use on my forms and shortcut menus - simple things like the "+" icon to use in my menu for the "ADD.." items. Do you guys have any websites I can download these from. I spent ages googling but they are such common terms I get everything else. Thanks in advance. Mark
-
error providerThinking about it I guess it is behaving as expected. ie: when leaving the control the validating routine runs and when it fails the action to move elsewhere is aborted through the e.cancel. So with this in mind I have moved the code to different events such as "TextChanged" and "Leave" BUT for some reason the errorprovider only displays on some occasions rather than all. Typically on the first time I enter an invalid value (such as blank ""), the errorprovider doesn't display but if I create the same error it displays. This validation stuff is driving me Nuts !!!! What do you guys normally do to validate a whole bunch of controls on a page ? I would have thought validating field by field was more user friendly than waiting til the end and doing it, but as described in my example sometimes it isn't practical to force a user to stay on the control.
-
error providerHi everyone. Hoping for some clarification how the error provider and the "validating" event works on a form, because what I am experiencing doesn't seem very user friendly for the end user. In a nutshell, once the control FAILS my conditions in the "validating" event and I issue the e.cancel command, focus returns to the failed control and I cannot move the focus until the control has a valid entry. Why is this bad ? For example, consider a textbox that accepts a file system directory path, and a browse button next to it. I want the advanced users to be able to type (using autocomplete) the path and basic users to be able to use the browse button. However once the textbox has the focus, any attempts to click on the browse button fail as the focus cannot move from the textbox that just failed validation. Now I have read a lot of articles, and it appears the error provider doesn't normally exhibit this behaviour. Am I right ?? If it is not normal, any ideas what might cause this ?? - I have a form with a tabcontrol that has several pages - I have an error provider on the form - All bound controls reference the same bindingsource - initially the error provider had a datasource of the bindingsource. I removed it and still nothing. Here is one of the pieces of code: Private Sub txtClientBaseFilePath_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtClientBaseFilePath.Validating Dim IsError As Boolean = False 'check if the string is not null using the basic textbox validation If IsTextBoxEmpty(txtClientBaseFilePath, strErrorPathNotSpecified & strErrorPath) = True Then IsError = True Else 'check if the patch exists. if not exist then offer to create the path Try If My.Computer.FileSystem.DirectoryExists(txtClientBaseFilePath.Text) = False Then If MessageBox.Show("Directory does not exist. " & vbCrLf & vbCrLf & "Would you like to create the directory?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then My.Computer.FileSystem.CreateDirectory(txtClientBaseFilePath.Text) SetStatusLabel("Directory '" & txtClientBaseFilePath.Text & "' created successfully", False) Else Me.epSystemSettings.SetError(txtClientBaseFilePath, strErrorPathMustExist)
-
Combobox driving me nuts !!!Good to see we are thinking on the same lines. I already tried it after I responded last, and it resolved the problem with one of the combo boxes but not the second one I am having problems with....but at least it is a start. Many thanks for your help. MArk
-
Combobox driving me nuts !!!Thanks for responding Dave. No validation yet. I've put together this form and not being experienced it has taken me days so I'm trying not to start again. The source is a simple DS/table. It saves back to another DS for the client. IF I remove the "Selected Value" from the combobox (so it has nowhere to save back to) the problem still occurs. This means the only thing on the combo box is the bound items to display the list. In an attempt to replicate the behaviour and see if it was the dataset, I created a new form and put a combobox and a textbox onto the form. All worked nicely......so I am still lost...
-
Combobox driving me nuts !!!Hi Guys, I have a combobox on a form. As soon as I click on the combobox I am unable to get out of it. The combobox shows me all the data it should, but I am unable to exit the control once selected. I can select any value, and do it any number of times however any attempt to close the form, click on another control in the form, etc fails. The only way out is to stop the debugger. No errors are issued. I've spent an entire day tryin to find the problem and can't. I'd appreciate any ideas please. The datasource is a very simple dataset (dsCorrespondenceMethods) containing a single table (CorrespondenceMethods). This table contains only 2 columns - an ID column and a description column. The table just contains a list of methods of corresponding such as "Email", "Fax", "Post", etc. I've put it into a table just to make any future changes simple and not require recoding of the app. Thanks in advance Mark
-
SQL Security for your appsThanks so much for taking the time to elaborate on the topic. Mark
-
SQL Security for your VB appsHi Dave, Thanks for your reply. Your response seemed to suggest on using limited SQL accounts if I read it correctly. Is there any reason you didn't mention Active Directory accounts and groups ?? I appreciate this topic is massive. I'd appreciate if you knew of any good resources (online or book based) that covered this topic well from all view points. I need a balance between security and functionality. I really want to limit the customers a contractor can see to just them, and if I have numerous contractors it's too hard to use numerous hard coded accounts.
-
SQL Security for your appsThanks for the reply Paul, however that doesn't solve the overall decision of using self-contained security accounts defined inside the account, or using Active Directory security.
-
SQL Security for your VB appsHi everyone, I was wondering how you all went about connecting to your databases from a security point of view. Some people say to use the SA password and embed security in your app with internal usernames/passwords, while others use Windows Security. I think the SA password idea sounds simplier, and has the advantage of being able to limit what data the user gets to (eg: which clients information they can see) HOWEVER it doesn't stop someone using the password with MS Access to bypass your app and get the data. So I was thinking the integrated security is best, and like any security, the use of groups would be best. My issue then becomes how to use those groups in SQL / VB.NET to enforce security, especially how would I enforce record level security (eg: which clients information they can see) Thoughts everyone ??
-
SQL Security for your appsHi everyone, I was wondering how you all went about connecting to your databases from a security point of view. Some people say to use the SA password and embed security in your app with internal usernames/passwords, while others use Windows Security. I think the SA password idea sounds simplier, and has the advantage of being able to limit what data the user gets to (eg: which clients information they can see) HOWEVER it doesn't stop someone using the password with MS Access to bypass your app and get the data. So I was thinking the integrated security is best, and like any security, the use of groups would be best. My issue then becomes how to use those groups in SQL / VB.NET to enforce security, especially how would I enforce record level security (eg: which clients information they can see) Thoughts everyone ??
-
Stored Procedures - Validating VariablesHi Pete, I was watching the Microsoft VB training videos by Beth Massi. She showed two things: - using stored procedures server side to make the app more secure - using VB code on the dataset to check data and issue error providor status for that column. These items are supposed to keep the "business logic" away from the forms and in a central location rather than re-keying in different forms. Well I put it into practice and it works nicely, BUT ONLY IF you type the right things in....but as we all know users rarely do as they should. I can break the system easily if I tab through all fields in the datagrid. The error provider flags them as needing attention (NULL ETC) but once you reach that last field it causes an unhandled exception. My instinct is to handle the excpetion on the form using an event like leavecell or dataerror (not sure on names sorry) BUT then I'm splitting my logic between the dataset, stored procedure and the form....and breaking the rules of centralising.... Hence I thought maybe I should look to do it in the stored procedure....but as you say that means the user doesn't get a mice message and warning......so confused
-
Stored Procedures - Validating VariablesHi Everyone. I'm finding it hard to get information of verifying variables passed into a stored procedure. Specifically if the value is NULL then I want to abort the procedure and let VB.NET know the insert failed without issuing an exception. I found some information that gave me the following IF statement but the layout is not like VB so I'm not sure where to go from here... IF (@RateLevel1 IS NOT NULL) OR (@RateLevel2 IS NOT NULL) NOTE: I borrowed the following code from a tutorial video so if you find any issues please let me know. ALTER PROCEDURE dbo.sptblBillingRatesInsert ( @Description nvarchar(150), @RateLevel1 money, @RateLevel2 money, @RateLevel3 money, @RateLevel4 money, @RateLevel5 money, @BillingLevelID int OUTPUT, @ModifiedStamp timestamp OUTPUT ) AS SET NOCOUNT ON; -- Inserts a row in Billing Rates INSERT INTO tblBillingRates (Description, RateLevel1, RateLevel2, RateLevel3, RateLevel4, RateLevel5) VALUES (@Description, @RateLevel1, @RateLevel2, @RateLevel3, @RateLevel4, @RateLevel5); -- Checks if the last statement produced an error IF @@ROWCOUNT>0 AND @@ERROR=0 SELECT @BillingLevelID = BillingLevelID, @ModifiedStamp = ModifiedStamp FROM tblBillingRates WHERE (BillingLevelID = SCOPE_IDENTITY());
-
Calling Stored SQL Functions from Visual BasicNo, and I don't want to either. It issues these errors when I hover over the "select fontname, fontsize....." In the old VBA I used to call the functions like: Dim Fontsize as integer fontsize = GetFontSize(strCurrentUser) ---- Function GetFontSize(CurentUser as string) as Integer ...... ...... ----- This meant I was able to use a single like to get my values and use them in lots of places easily. When I read I should store these server-side I was very happy. I just need to call the function and return it to my current sub easily without having to do too much coding to setup and call the function otherwise it defeats the purpose FYI I spent all weekend playing with the new error provider - very nice but it took me the longest time to work it out nicely....MS documentation is horrible....I found Google far better than MS own doccu... Mark
-
Calling Stored SQL Functions from Visual BasicThanks Paddy. I need to return some values and use them so I think the function would be best, but there seems to be some debate here if it can be achieved. Excuse my ignorance but my previous coding was for MSAcess so I"m trying to learn SQL server issues, and move from VBA to VB.NET. I have put in the SELECT statement you sugessted but the compiler tells me "Select CASE must end with a matching END SELECT", and hovering over FROM in the statement gives me "name not declared" . Obviously I need more code to setup the SQL statement - could you kindly give me an example please. Many thanks Mark
-
Calling Stored SQL Functions from Visual BasicThanks Duncan. I need to return some values and use them so I think the function would be best. Excuse my ignorance but my previous coding was for MSAcess so I"m trying to learn SQL server issues, and move from VBA to VB.NET. I have put in the SELECT statement you sugessted but the compiler tells me "Select CASE must end with a matching END SELECT", and hovering over FROM in the statement gives me "name not declared" . Obviously I need more code to setup the SQL statement - could you kindly give me an example please. Many thanks Mark
-
Calling Stored SQL Functions from Visual BasicHi Everyone, Wasn't sure if this was a VB or SQL question and where to post so I am trying here. I read it is better to use stored procedures and functions on the SQL server to centralise and re-use code, as well as allowing us to restrict rights to EXECUTE rather than full rights. I wanted to retrieve (and maybe in another function SET), some data so I wrote the following basic function and stored it on the server. My problem is that no matter how I try, I can't seem to find a way to call the function from my VB.NET 2005 application. Please help ALTER FUNCTION dbo.GetEmployeeFont ( @EmployeeID int ) RETURNS TABLE AS RETURN (SELECT FontName, FontSize FROM tblEmployees WHERE (EmployeeID = @EmployeeID))
-
Calling Stored SQL Functions from Visual BasicHi Everyone, Wasn't sure if this was a VB or SQL question and where to post so I am trying here. I read it is better to use stored procedures and functions on the SQL server to centralise and re-use code, as well as allowing us to restrict rights to EXECUTE rather than full rights. I wanted to retrieve (and maybe in another function SET), some data so I wrote the following basic function and stored it on the server. My problem is that no matter how I try, I can't seem to find a way to call the function from my VB.NET 2005 application. Please help ALTER FUNCTION dbo.GetEmployeeFont ( @EmployeeID int ) RETURNS TABLE AS RETURN (SELECT FontName, FontSize FROM tblEmployees WHERE (EmployeeID = @EmployeeID))