To make it clear this IS homework, however this is also a method of research. i only ask when i get in binds i can not find answers to in other forums . There are so many i could spend more time[code]...
I am checking for empty string values, but how do i see for the Quantity text box if the user chose only numerical values after the empty string. For example...
The problem is that if you never enter anything into a cell for a new row then that cell is never validated. This is a problem because I have columns that should not be null. I am doing the check in the row level validation and storing the information about which cells are empty that should not be empty. The row level validation works fine and the row level validation error indicator goes on,(red exclamation mark at the beginning of the row) but I also need a visual indicator on the individual cells that are in error.
I am thinking that setting the HasError property for the cells that are in error should cause them to display n error style (the default red border). Is there a way to this this either from XAML (perferably) or from code?Alternatively I could cause those cells to re-validate when the row editing is finished. Does anyone know how to do this?
This must've have been asked before but I couldn't locate it. In a mixed code project (VB and C#) we were debugging some old Visual Basic code where a statement as follows could be found:
If Request.Params("xxx") <> "" Then 'do something
I considered this a bug as Request.Params could be null, in which case the statement would've become false which wasn't the idea. So I thought. I just found out, -- probably for the tenth time and I will keep forgetting -- that the following two statements are not equal, while Nothing in VB should be equal to null in C# (thought I):
if(String.Empty == null) // always false If String.Empty = Nothing Then ' always true
Should I dismiss this as a typical Microsoft backward compatibility effort, or should I consider this a huge error in the VB.NET compiler? Does anybody know the Microsoftean opinion on this oddity?
Using VB.Net If the grid cell value is empty, i am getting error as "Conversion from string "" to type 'Double' is not valid"Code (gridview_CellLeave)
Dim z1, z2, z3, z4 As Int32 If grvList.CurrentRow.Cells(1).Value <> "" Then z1 = grvList.CurrentRow.Cells(1).Value End If If grvList.CurrentRow.Cells(2).Value <> "" Then
I try to compile a project with msbuild.exe I have this error :
vbc : error BC30136: Error creating Win32 resources: Error reading icon '"Recycle Bin Empty.ico"' -- The filename, directory name, or volume label syntax is incorrect.
This icon is the Application icon which is in the same directory of the project.vbc is started with /win32icon:"Recycle Bin Empty.ico" parameter.Don't know why MSBuild can't reach the file.
I was trying to call a method using Reflection on a method that has a STRING parameter.However a STRING does not have a parameterless constructor.So instead of something like.>>
Option Strict On Option Explicit On Option Infer Off Public Class Form1
i have a string array that i want to output to a text file. the array size is 10000. i fill the array starting from 0 with some strings. at the end, i only want to show the array from index 256 to the last array that is not empty (for eg. if the array is filled with data from 0 to 2000, i only want the text file to show the data from 256 to 2000 and ignore the remaining strings). Is there any function to do this?t i use is shown below
Dim myArray(10000) as string Dim strArray As New System.IO.StreamWriter("c:List.txt") strArray.WriteLine("{0,10}{1,30}", "Index", "Symbol")
i have a string array that i want to output to a text file. the array size is 10000. i fill the array starting from 0 with some strings. at the end, i only want to show the array from index 256 to the last array that is not empty (for eg. if the array is filled with data from 0 to 2000, i only want the text file to show the data from 256 to 2000 and ignore the remaining strings). Is there any function to do this? i am using visual basic express 2008. The code that i use is shown below
I have a nullable database field of type varchar. I am writing a unit test for a service method that retrieves the value of this field. The service method uses a custom DAL that returns a value of String.Empty if the database field is Null (this is desired behaviour).
just found out that replace(string does not do the same as string.replace when my string variable was an empty str the first one returns "nothing" and the second returns an empty string (as expected).just sloppy coding anyhow, it was a function that was converted from classic asp and never rewritten properly. [code]
In my spare time i give myself programming stuff to do. Today i want to write a function that goes through a string, if the string contains any numeric value the function must return false, if the string has any special characters it must also return false else return true. For example the following strings would return as follows:
I am writing a program using a structure for the first time. The structure has 10 string variables declared inside each equal to a individual textbox on a form. I need the program to be setup so that if one or all of those textboxes are empty at the time of the event being activated a messagebox is displayed telling the user one of their textboxes is blank. Now i could do this in a series of 10 if then statements im sure but using a structure theirs got to be an easier way.
I have a user control which exposes three properties that the user can change - ValuesStart, ValuesEnd, ValuesIncrement. The default values of these are 0, 100, 10 respectively. These are conditional in that ValueStart needs to be less than ValueEnd, ValueEnd less than ValueStart and ValueIncrement greater than 0. I have put this logic into the property setter and have been testing the functionality of this through the designer and in code but when I do the following I get an error saying that ValuesStart has to be less than ValuesEnd:
I am raw to this and have been plodding along slowly to get a little windows application working. I am having some issues when testing my application. I've included the sample code that I am using:
[Code]...
I believe this is referring to the connection string. I've set breakpoints and checked that the entry in the password is correct (and that there is a value in it).
A wrong entry into a textbox causes the errorprovider to appear (set in the validation event e.cancel=true).Can I close the form (X in the upper right corner)?
I am executing this validation summary program in Visual web developer 2008 express edition, found the validation summary property is not visible in output.
<div><asp:ValidationSummary ID="sum1" runat ="server" ShowMessageBox="false" HeaderText="You details cannot be processed due to following errors:" DisplayMode="BulletList" ShowSummary ="true" Font-Names ="arial" Font-Size ="12"></asp:ValidationSummary> <asp:CompareValidator ID="cmp1" runat ="server" ControlToValidate ="txtname" Display="Dynamic" Operator="DataTypeCheck"
<asp:CustomValidator ID="QuestionValidator" runat="server" ErrorMessage="Please select an option" ClientValidationFunction="QuestionValidator_ServerValidate" OnServerValidate="QuestionValidator_ServerValidate" ValidateEmptyText="true"></asp:CustomValidator>
I have a list of questions provided by a datalist, which I need to ensure a user selects an answer to each question. I then have my validation functions:
Protected Sub QuestionValidator_ServerValidate(ByVal source As Object, ByVal args As ServerValidateEventArgs) Dim SelectedItem As Boolean = False For Each c As Control In Page.Master.FindControl("form1").Controls If TypeOf c Is RadioButton Then
[code]....
When I run the page, there is no validation and no error message. Please can you point out where I am going wrong, I'm suspicious it is at Page.Master.FindControl("form1").Controls.I have previously done such validation by looping through controls via form1.controls but this is unavailable as the page uses a form passed down via the master page.
I am trying to send an email from a windows form application. I get the following error:
Message="The remote certificate is invalid according to the validation procedure." Source="System"
I do not care if there is a problem with the remote cert. How do I tell my application disregard and send anyway. Here is my
Public Function SendEmail(ByVal strEmailID As String, ByVal strFrom As String, ByVal strTo As String, ByVal strSubject As String, ByVal strBody As String, ByVal strHTML As String) As Boolean Dim blnSent As Boolean = False
I have a webpage that has a Telerik RadComboBox on the page. One of the properties of this ComboBox is EmptyMessage, which fills the combobox with a message when an item is not selected. I am binding my combobox to a datasource at runtime and for some reason, it wipes this EmptyMessage away. Is there a way to keep my data items in tact and have the empty message there too?
I'm using VB's StringBuilder, and I was curious what is considered "best practice" for emptying the builder/setting it to a new string. Would it be something like this:[code]or is there a "Better" way?
Possible Duplicate: In C#, should I use string.Empty or String.Empty or "" ? I just don't understand the benefits of using String.Empty over "". Aside it being strongly typed its longer.
Why does the first if statement evaluate to true? I know if I use "is" instead of "=" then it won't evaluate to true. If I replace String.Empty with "Foo" it doesn't evaluate to true. Both String.Empty and "Foo" have the same type of String, so why does one evaluate to true and the other doesn't?
//this evaluates to true If Nothing = String.Empty Then
With that said, shall the Private Property Attributes() As String() not return the values of DirectoryAttribute placed over the interfaces properties as well, since I specify True in the inheritance parameter of the Type.GetCustomAttributes method?
Im trying to improve some apps ive written, the first is a console app... Im trying to get it so that i wont get an invalidcastexception if the user inputs a string, when the variable is type "Double"