Asp.net - .net - RsData / Cleaning Up Code?
Mar 21, 2012
I have a question regarding VB.net and the use of rsData connections to an SQL database.Basically we have a few inline pages that will display course information of courses that my institution runs. The code will connect to an SQL DB and pull through live data directly in the following format.
html += "<tr><td>" & rsData("M_Start") & "</td><td>" & rsData("WEEKS") & "</td><td>" & rsData("DAYSTIME") & "</td></tr>"
Now I was wondering if people would suggest pulling directly from an open DB connection or map the RsData results to strings? All data connections open and close after they have done their required portions and we have around 5 different procedures that occur within the page.
View 1 Replies
ADVERTISEMENT
Nov 28, 2010
I am just starting out with a practice VB project which involves selling donuts and coffee. I have written out the code which the program works but the code is very messy. This program contains functions and radio buttons to calculate a subtotal, tax, and total due. There are four variety of donuts in Group Box 1 listed as: Glazed at .65 each, Sugar at .65 each, Chocolate at .85 each, and Filled at $1.00.
The coffee choices in Group Box 2 are listed as: None at 0.00, Regular at $1.85, and Capuchino at $2.50 each.I want the cashier to be able to select a radio button to choose between the donut choice in group box 1 and then choose one coffee choice in group box 2. A textbox calculates the subtotal, a textbox calculates a tax of 3%, and a textbox calculates the total due adding the subtotal and tax.
Everything works fine but Ias I said before it is quite messy which I keep making it worst.I need to write one function to calculate the donut, one function to calculate the coffee, and one function to calculate the sales tax. Then I need a sub procedure to clear the subtotal, sales tax, and total due amounts when a radio button is clicked.I have been working on this for the past month ,code I have so far:
Class frmMain
Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()[code].....
View 4 Replies
Jan 6, 2012
however there is a portion in this code that can be simplified more (the if orelse statements). I know it has something to do with a collections class or an array, but I'm stumped on how to change it.
Function GetLastName(ByVal accountName As String) As String
Dim lastName As
Dim stringArray As Array = accountName.Split(" ")
[code].....
View 1 Replies
Mar 21, 2012
I'm doing the following to try and determine whether display a course online based on whether its in the future or would have started in the last 30 days.
If Date.Today.AddDays(-30) >= CDate(rsData("Start")) then
html += "<tr><td>" & rsData("Start") & "</td><td>" & rsData("WEEKS") & "</td><td>" &
rsData("DAYSTIME") & "</td>
However this doesn't seem to work and blocks for instance the following rsDATA(("Start")) value.
2012-09-10 00:00:00.0000000
View 1 Replies
Feb 7, 2011
I have the following string which I need to get onto one line for database storage and retrieval purposes:
{"id":8,"heading":"heading goes here","content":"<p>
content goes here</p>
"}
[code].....
View 2 Replies
Jul 20, 2010
Basically if i wanted my controls to be checked at startup id use a setting obviously
'UI Settings
chkCloseToTray.Checked = My.Settings.CloseToTray
chkAlwaysShowSystemTrayIcon.Checked = My.Settings.AlwaysShowTrayIcon
[code].....
View 3 Replies
Jun 22, 2009
if i have a string like 12.4.23 how can i clean the dots? i want 12423
View 2 Replies
Nov 21, 2011
I've been making a game using a Console Application as the main window, for the it. The game requires you to make the right choices in a mini Hacking adventure, but I'm rather stuck in an area where the player is required to enter the name of the file they would send and the program does not recognize the right one, also I was wondering how I could tidy up my code as It seems to be growing at a unnecessary rate.[code]
View 6 Replies
Sep 11, 2009
first, what is the base minimum that windows needs open to run... ex. svchost.exe, explorer, etc.
Second. is there an easier way to close all programs except the ones i want to stay open, i want to keep the needed basics open and my program, which will open other programs, but i want to make sure nothing else is running so that things will go as smoothly and as fast as possible. I just don't want to manually check what processes need killed and place them in the program one by one, i want to kill all but a few.
Extra credit... stopping all unneeded windows services would be nice too, but that would probably be too long of a process to worry about, and not really worth it considering the benefit of speed it would give.
View 3 Replies
May 5, 2012
I've rearranged the error messages to different spots with no luck. The txt row need to be a number 1 to 10. The txtSeat need to be A,B,C, or D and the txtPassenger shouldn't be left empty.
Public Class Form1
Dim seat(9, 3) As String
Dim waitingList(9) As String
Dim passengerNames(9, 3) As String
[code]....
View 8 Replies
Dec 3, 2009
I'm comparing a temporary table to an another table, to check for changes in the cells. The way I'm doing it, is that I'm using three loops; one to loop trough the temporary, one to loop trough the other table and a last one to loop trough each column. Here's the
vb.net
For Each row As DataRowView In View
For Each drow As DataRowView In view2
[Code]....
"emitid" is the column I use as a reference to be sure that I'm comparing the correct rows, and the column order will always be the same in both tables.
View 4 Replies
Nov 11, 2010
Not sure if this has been asked before (couldn't find an answer), but is there a way to reuse a user.config file from a previous version of the application? For example a user.config file is stored in:
C:UsersJohnnyAppDataLocalCompanyApplicationName.exe_Url_wxcnyrmstqy3oj1qwckdjq3gjqkq4fel1.0.0.0user.config After a new version is installed it gets stored in:
C:UsersJohnnyAppDataLocalCompanyApplicationName.exe_Url_wglmejvw01nagu5t1y5yl12chynjomny1.0.0.1user.config The user then has to enter all settings again, even if the new version does not save more settings. An other problem is that although the user.config file is very small, it does get messy after a while when newer versions of the application get installed. Is there a way to clean up the unused user.config files and their folders?
It's the same problem with System.Windows.Forms.Application.LocalUserAppDataPath, that I'd like to use to save other files (containing Listview data), which points to:
C:UsersJohnnyAppDataLocalCompanyApplication1.0.0.0 The Listview data and other files created by the app can't be used anymore.This can be solved by getting the user's appdata folder with Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) and creating a new folder there with the name of the application. But this means there's one folder where the application is installed (user can choose this folder in the installer), one folder to save my own files to and one folder where VB stores the user.config file.
Can something be done about this "mess" or is this just something I have to live with?
View 2 Replies
Apr 21, 2010
I got a timer that saves like cache in a map and cant delete really cause it updates so quick that if i code to delete the folder and create a new emptey folder it craches cause "im already running /using that file"
Some one got an idea how to clean up? cause afterwhile it take a lot of space If you donīt Believe in it, Then it Doesīnt Exist!
View 4 Replies
Dec 8, 2011
I have some code to execute code at runtime...
Here is the main
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If TextBox1.Text.Trim <> "" Then
If TextBox2.Text.Trim <> "" Then
[code]....
When the button is pressed, it all works and the following files are created: yahoo.dll and yahoo.pdb My question is this: What is the code to load the already compiled yahoo files to execute the code again, without having to recompile the code?
View 1 Replies
Jul 19, 2011
This code was posted in Chit Chat and everyone is saying how great it is. I just have Visual Studio 2010 and no familiarity with VB6 so I thought it would be good to convert the code to Visual Basic 2010.
[Code]...
View 39 Replies
Sep 9, 2011
this code was not done by me originally and there are some thigns here i dont quite understand i have altered it a bit from my coworkers code to suit my data and it works. but too slow. and when i have 4000+kb excel files it might freeze altogether. ( I have checked tho that when and after this transposer runs it will still be within the excel row limit, i had done calculations before and made a macro to automatically split excel files based on number of columns and rows to make sure this is so ). This code seems to start out fast then goes slower the longer it runs. at least this is what it seems liek to me.
[Code]....
View 2 Replies
May 26, 2010
i recorded the following macro in excel 2007:
[Code]...
View 3 Replies
Jan 2, 2012
I recently found this code (provided for third party use on another VB site), however,ll of my attempts to insert it into a class library have failed.I open a new class library and past the code in, and immediately get several errors pertaining to how certain objects can't be found. I find it it is crucial to use this code, unless someone can suggest to me another example of existing code that will do the same thing: make a restricted textbox who imputs can be restricted, that can handle pasting, shortcuts, text property setting, and script-entered text.
Option Strict On
Imports System.ComponentModel
Public Class RestrictedTextBox
[code].....
View 9 Replies
Nov 24, 2010
I have been playing around with different types of native code operations in Visual Basic and then inspecting the code with Reflector to see what kind of MSIL is produced. For example, I wondered, in a one line If-Then-Else different than an If-Then-Else split onto multiple lines, ie.
[Code]...
View 3 Replies
Feb 20, 2011
what is wrong with my code and I get no feedback from my button click event, i have imported. ( code Below) and i have tied differrent combinations of the code without sucess.maybe add extra to my code for the list to show open Port or closed ports.
Imports System.Management
Imports System.Management.ManagementObjectSearcher
Imports System.Management.ManagementNamedValueCollection[code].....
View 9 Replies
May 1, 2012
This code is for 2008, 2010 and later versions of VB.Net as it uses an extension method.Please note: If you are using an earlier version ( or you do not like extension methods ) please see the next post.Here is the code I posted on Monday April 30th, 2012.>>Now you can specify the startRadius to be
View 7 Replies
Dec 13, 2009
I have this string just down loaded of a Unix server. I would like to remove the box (0x0A) Unix end line code; then replace it with CR+LF normal ASCII code. Also, I would like to do the replace before I save the data, while it in memory.
View 14 Replies
Jan 18, 2012
I had a weird series of errors involving e.Graphics.DrawString() when painting a panel.I am using a barcode font [Code 128] with a library that converts text to the proper format for Barcode readers.That's fine, however, when I draw it to the panel, that's where things stop being fine:But, here's where things get funky. When I put it into a TextBox instead of drawing it via Graphics.DrawString(), everything is peachy:In fact, the TextBox one looks much better than the Graphics.DrawString() one! Am I doing something wrong?[code]
View 2 Replies
Jan 9, 2012
I realize this post is rather long, but I wanted to give all the information up front instead of people having to ask me for more information.At the end of the re-installation of Visual Studio 2008, there is this message:
"Microsoft SQL Publishing Wizard: [2] Error: Installation failed for component Microsoft SQL Publishing Wizard. MSI returned error code 1638" in the log file dd_error_vs_procore_90.txt.
I have searched on Google for this whole message and found some references to this error, but I have done what they said worked for them and it did not fix the problem for me.When I searched for just "MSI returned error code 1638", I got that it cannot install something because it is already installed:"Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel".In Add/Remove Programs I see these two programs:
Microsoft SQL Server Database Publishing Wizard 1.3
Microsoft SQL Server Database Publishing Wizard 1.4
Are these programs/versions what the error is refering to? Am I safe to remove them and depend on the similarly-named item which would be newly installed with Visual Studio 2008 - "Microsoft SQL Publishing Wizard"? I still use SQL Server 2000 and 2005 on my computer, as well as 2008. I had installed VS 2008 on my computer before without this problem and also have VS 2005 and 2010.
View 1 Replies
Sep 1, 2011
I'm using ASP.net 4.0 VB,I am using a session variable to add a user entered code into the url of each page. I can get the code to show up at the end of the page's URL that my textbox is on, but what do I add to every page to make sure that the session stays at the end of every URL that person visits during their session? This is the code from the page that the user enters their user code.
Protected Sub IBTextBoxButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles IBTextBoxButton.Click
Session("IB") = IBTextBox.Text
Dim IB As String = Session("IB")
End Sub
[code]....
This is what I have in the page load of one of the other pages. What else do I add to make sure that variable is added to the URL of that page?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim IB As String
IB = Session("IB")
End Sub
View 3 Replies
Jan 24, 2011
i am asking that can i use c# language to implement "actions" fired on "click side events" such as mouse over the reason for this stupid question is that i remember some syntax of registering functions for particular events of formview, which are call when the event occurs (yes there ispostback involved" is something like the above possible for client side events using c# or even vb.net
protected void Page_Load(object sender, EventArgs e)
{
Label3.Text = "this is label three";
[code]....
View 3 Replies
Feb 15, 2009
I have a program that runs some code when i click a button on a form when done running the application ends. I want to automaticaly run the code when the users clicks on the exe. I have put the code that i want to run in the startup forms load event but that doesn't start
View 2 Replies
Sep 10, 2010
In my project, I have a local dataset (XSD) that I am using as local-temporary tables. I am getting a System.InvalidCastException when trying to access the field in one the tables. I believe this is because I my code is (incorrectly) not setting a field's value in a row before trying to access it.My problem is that the exception is breaking in the designer file and not in my code. As a result, I'm having difficulting determining which line of my code reading the field value before it has been set. Is there any way to configure Visual Studio to break in my code instead of in the designer created file?
View 1 Replies
Jul 2, 2009
I have made an application in VB.NET.The Button click codes are working fine. I have made a small modification in the code. I have commented the line 'Me.Close'But still my form gets closed. I think the application is executing from elsewhere.
View 8 Replies
Feb 23, 2010
There has been an Visual Studio addin created by Heslacher based on code by JohnWein which allows one to copy code in Visual Studio and paste it as HTML code block here in the forums.urls...
View 10 Replies