Detect If Text Box Is Showing 15 And Descending And Then Perform Action
Mar 7, 2009can i detect if a text box is showing 15 and descending and then perform an action?
View 5 Repliescan i detect if a text box is showing 15 and descending and then perform an action?
View 5 RepliesWhat i want is i have a listbox in form a, which display data from database, for example it's displaying student ID.
after user double click on the id, form b will "show" and load that particular informations.so should i do that action in ListBox1_DoubleClick or form b_load?
When i upload my site in aspspider.com then it shows the following message.I use default dataase of asp.net namely ASPNETDB.MDF
Server Error in '/dobriyal' Application.User does not have permission to perform this action.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: User does not have permission to perform this action.
Source Error:
Line 7: Dim cmdSelect As New System.Data.SqlClient.SqlCommand("SELECT Password FROM a1_admins WHERE EmployeeId =" & TextBox1.Text & " And Email = '" & TextBox2.Text & "'", SQLData)
[code]....
I'm using VS2010, SQL2008 and using asp.net vb - im stuggling with some db related items.I have a couple tables, Project and Projectstatus - looking something like this.project
- ProjectID (autoincrement)
- ProjectName varchar50
- Projectoverview varchar200
Projectstatus
- statusID (autoincrement)
- projectID varchar50
- projectstatus varchar200
What id like to happen is that when i create a new project (into the project table),that a row is created in the projectstatus table, inserting the projectID from the project status for reference.I don't think this can be done from within VS, correct? therefore, do i need to create a SP to perform this action from DB side?
I'm using ASP.NET/VB.NET to create this with SQL 2005. I have a project where I'd like to take a set of records from a table, then send each one through an API, get a result and writeback the result to a table, then move to the next.
Initially, my thought was create a SQLDataSource that grabs all the records, then perform the action on a button to do the action of sending through each record.
Is there a way I can call the recordset from SQLDataSource and perform a loop? I'm thinking something like in Classic ASP/VBScript where you would open a RecordSet, do an action, then Loop until the RS was EoF.
My app pulls news stories from my website and dumps them in a contextmenustrip. If for some reason they can't be gotten, then a refreshbutton appears instead.I'm using this code to perform an action based on the content of a contextmenustrip. But how do 'override' the default to allow for the 'refresh' option? ie - would should I put here -->
[code]...
I am currently trying to create a log in form that requires a user to click buttons in a specific sequence (other than the traditional username/login format) in order to open another form. I am new to Visual Basic 2008.
View 3 Repliesis it possible to perform an action when the tab key is pressed in a textbox or the mouse cursor is moved to another box?
View 1 RepliesI have a WinForms DataGridView control on a form. There are two fields in this DataGridControl:
Email Address
Resolved Email Address (calculated based on the input in Email Address)
After the user inputs or changes a value in Email Address, I want the value in Resolved Email Address to update based on a separate method. What event should I tie in to so that that the Resolved Email Address cell is updated after the Email Address cell is updated?I'm not sure where to put the event because the user could do a number of things after adding/changing a value: tab to the next cell, click cancel on the form, click ok on the form, etc.
Basically, It is a program that allows you to automatically click things.
Here is the
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
[Code].....
What I wanted to do was make an option to have variations in tick time. I want to put in a check box, and if it is checked then there will be 10 "variations" in click time, ranging from 1 second too soon, to 1 second late.
I'm new to VB and Windows programming but I do have a fair amount of experience programming at the command line level. A friend is having problems with his laptop. He does a lot of speaking engagements with Powerpoint. His laptop uses the F7 key to toggle the output to his external monitor port to the video projector. The F7 key has stopped doing this. Is there a way to create a Windows program that will do this without using a DOS window? He is not familiar with command line processing and needs something that he can double-click.
View 2 RepliesSay you wanted to set a status message
' Set status
ssMainMessages.Text = msgValidating
Then perform an action that requires a http request that takes around 5 seconds then you want to display the result of that
' Set status
ssMainMessages.Text = msgValidated
It will only always display the second message? Its like it jumps the first part of the code and goes straight to httprequest.even if you put the update,system,threading.thread.sleep ....
i have a button and if a specific option is set (via a checkbox) then once every 5 times the button is clicked an extra event happens.I thought a counter/Integer would be the way to do it but i cant seem to get it quite right, heres my code i have in the buttonclick event:
[Code]...
I had tested this code: [URL] It works, but a Word application is opened and each new paragraph added using VB code is seen one by one(with a small delay). If I want to open and write something using VB, what is the fastest way ? I do not want to view the changes made on word document live. I want to save the document. So will oWord.Visible = False makes it fast?
View 1 RepliesI am creating an Excel Add-In using Visual Studio 2010. My intention was to add a context menu to a cell and perform some action on the selected cell or cells. Here is the code I have got as of now
[Code]...
i have a DataGridView responsible for showing a bit of data and two of my columns allow for user input using comboboxes.The trouble is that one column only needs to show preset values in it's list, but the other needs to both show the presets and allow for the user to enter in their own values.i accomplish this by showing the editing control for the combobox with this bit of code:
Private Sub DGV_EditingControlShowing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DGV.EditingControlShowing
[code].....
a datacontext defined in a module(domain services ado.net ria)a page having add/delete methods whenever any method is executed, it is found that all the previous actions (NEW RECORD ADDITION and DELETION OF RECORDS) are carried out before the new action is carried out normally
this behaviour is not prominent but "when using break points and inspecting the values of the variables and table object to be added to context, it is clear that all the previous actions take place again. even when the datacotext. savechanges is called, even after that still all actions carried out on the datacontext repeat themseleves, when any new action is to be carried out
I have a code, but it doesnt work.
[Code]...
How would you go about performing calculations on parts of inputted text in vb 2008?For example: if i wanted to find the number of "a's" in the first 9 letters divided by 9 and add it to the second number of "a's" in the second set of 9 letters divided by 9. Then output the total in a textbox.
View 7 RepliesI have been wondering about this for a long time and have not found any ways to do this other than write my own text editor for it. Regarding the following lines of
[Code]...
I have a program that generates text tab-delimited files with a header row and sometimes a units row followed by data.
Example:
FirstName LastName Birthday
Michael Jordan 6/6/66
Alan Jackson 7/7/77
or
FirstName LastName Birthday
Name Name Date
Michael Jordan 6/6/66
Alan Jackson 7/7/77
I would like to be able to perform SQL queries on these files. How can I connect to a text tab delimited file to either pretend it is a database table or import it into SQL as a table, preferably through VB.NET? I could have 300,000 rows, and the fields are all numbers, not text... I have manually imported these files into SQL before using management studio, so I know it is possible but I would love to be able to do it programmatically.
Is there any way I can get the SQL code from this process because it does exactly what I need it to do but it is manual. There is an SSIS package that I saved, but I do not know what that is.
I came to a company that already has a fully grown project... but coders that worked here before me didn't follow conventions and didn't use parametrized SQL queries... as a result there is over 1000 places in a very huge project that can possibly be vulnerable to SQL injection...
I need to find a solution that will automatically detect if there is an SQL injection in the code. So, for example there is a form which allows user to enter comments regarding a product, which will be sent to database on submit... how can we make sure that a user didn't enter a harmfull query instead of a normal text?
Is there any advanced code/regular expression/magic that can detect if this text contains a piece of SQL query instead of normal harmless text? I will accept any links, pieces of code in any language or even commercial software that will do that for me.
Design a form, which contain a TEXTBOX control that accept a UserID input, with a CommandButton control to perform a validation based on the criteria listed below. Display a Message on whether the UserID is Valid.
Criteria:
The UserID must contains SIX digits follow by a single character, limit the entry to a maximum of seven characters only.
The postfix character of the UserID is derived from the summation of all the six digits divided by seven and using the remain as followed:
Remain
Character
0
A
[Code].....
In my program I want to add some values together with a running total, and then show that total in a text box. When I try to run it, though, it just shows zero.Here's the code I'm using
TotalPrice = TotalPrice + Price
Next
TxtLuggage.Text = TotalPrice
this chunk was a part of a For next loop.
Something annoying suddenly happened with a text box in a self made program in Visual basic 2008. Whenever I try to run the program, this text box shows what is behind the program itself. (For example my desktop background)
Not only that, if I click on it with the mouse, the window which is behind my application will pop up in front.
I tried to replace it with a new text box and a new name, in case I'd been messing around with some wrong properties, but the problem still remained.
I don't know why but text that should display in a text box, ALSO appears at the top of the form, where the title would be. Here are pictures of what I mean. The first picture is before the button to display the text is clicked. The title at the top is "Surrogates (20009)". The second picture is after the button is clicked and as you can see the text shows up in both the textbox and at the top.
View 5 RepliesAssume that there is a web site which includes 3 different pages. I want to show a text one of the pages randomly, with is formatted with css.
For instance the pages are below:
hello-world.aspx
hi-sun.aspx
good-night-moon.aspx
* When John enters to the site, the text will appear on hi-sun.aspx,
* When Elmander enters to the site, the text will appear on hello-world.aspx
And when one enters the page which includes a special text, even if come again, it shouldn't appear.
Psedue Code:
if(Session["first"] == "1"){
//show the text in a random page }
else {
//text.visible = false
}
In the if block how can I supply the text in a random page. (it shouldn't appear in every page, should appear only one page).
I have a form used to display records read from a dB. The record fields are displayed in textboxes to allow editing. When the form loads, it reads all records from the table and loads the first record to the form - very straighforward. I set the Textbox.Readonly = True after loading the data. I have an "Edit" button that sets the value back to false so that editing can occur.
All fields display correctly apart from the first field textbox where there appears to be no text displayed. If I press the "Edit" button and set the cursor into the textbox and use the arrow key to move left, the text is there. In other words, the text is loaded to the textbox but somehow it is hidden. Now if I move to the next record the field information displays correctly. The problem only occurs when the form is first loaded and the first record is displayed.
Now for the strange part. If I delete that (first) textbox from the form and then re-create it, the weird behavior moves to the next textbox control and the first textbox behaves correctly. I have checked all the properties for the textboxes and made sure they are all the same. I have had this problem before and found the only way to overcome it was to regenerate the entire form again. Does anyone have any clues on what is going astray?
Ok I am trying to make it so that if words are found within the 'Textbox1.text' they will be delete or remove or completely not allowed to even be entered into the text box. I have found a code on these forums from a previous post which has worked for me
View 6 Repliesjust ran into an odd problum with treeview node text I add a top node and I wanted it's text in bold. The bold works fine but half the text is missing
Here an example
vbnet
Dim sFont As New Font("Verdana", 8, FontStyle.Bold)
Tv1.Nodes.Add("TOP", "0123456789", 0, 0)
The code above for me only shows 012345678 and not showing the 9 any ideas if I use regular style it works fine only happens when I apply the bold style.