VS 2008 - Using Function In Order To Get Item Code From Database Long.Parse(myReader(0)).ToString("2200000000000")

Oct 26, 2009

I would like to ask some questions related some functions i want to make in my program:

1. I am using this function in order to get a the item code from the database Long.Parse(myReader(0)).ToString("2200000000000") the result i get is: 2200000059091. The form that i want the resultset is
22 (fix value) + item code (6 characters right justified) + 00000 (fix value) 2205909100000 how should i change my code to obtain this result?

2. The programs every time it runs creates a text file which i also attached it plu1.txt, when i try to open it with notepad i see all the lines justified, on the other hand when i open the text file with Wordpad or ConTEXT the lines are not fixed, others are longer others are shorter? What should i change in my code in order to have every line fixed lenght... The code i am using is the following

Dim myReader As SqlDataReader = myCMD.ExecuteReader()

Dim fNextResult As Boolean = True

Using myWriter As IO.StreamWriter = New IO.StreamWriter("c:everest

[CODE]...

3. third and last question is that my program every time it ends show up a pop up menu which says "Text is created." Instead of this i would like to create a file lets say log.txt and every time the program runs, it will overwrite on the log.txt file a line like this: system date + Text is created + with X lines (where X are the lines of the text plu1.txt) ex. 26-10-2009 14:56 Text file created with 15 lines

View 4 Replies


ADVERTISEMENT

What Is The Code In Order To Have The Same Function As E.cancel

Sep 21, 2011

i want to do this:when user click save button, the form must be check first..if user did not insert the required data, user are not allow to save form..

the code:

Private Sub AssetMasterBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AssetMasterBindingNavigatorSaveItem.Click
'if group code is null, user are not allow save...

[code]....

what is the code in order to have the same function as e.cancel?e.cancel is used in formclosing event. which is to stop the form from closing

dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf'
dp.SyntaxHighlighter.HighlightAll('643bb21f2cc945e88ed0d584c122bc17')

View 3 Replies

Search Function In Program In Order To Find Records From An Access Database

Oct 16, 2009

i have a search function in my program in order to find records from an access database... all the other functions add/edit/delete are working just fine this is my code for search function: [code]

View 16 Replies

Private Declare Function BlockInput Lib "user32" (ByVal FBlock As Long) As Long?

Dec 26, 2009

In Visual Studio 2008 I am using :Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long To stop input from occuring during a search-replace operation.

BlockInput(True) ' do not allow input during search and destroy
Dim cursorIcon As Cursor
cursorIcon = Cursor
Cursor.Current = Cursors.WaitCursor

Then setting it to false at the end of the operation. It did not work, so I thought maybe it was because I was calling it from a child window, so I created a function in the mainwindow, and ran it like this:

FrmMain.BlockFrmMainInput()With these functions is the Main window:

[Code]...

It did not solve the problem. I thought maybe it was because I was running under the debugger, so I tried compiling and running it debugger-free, but that did not do any better. I am still getting input when I double-click the mouse on either form.

View 2 Replies

Redirect And Parse In Realtime Stdout Of An Long Running Process?

Apr 12, 2010

This code executes "handbrakecli" (a command line application) and places the output into a string:

Dim p As Process = New Process
p.StartInfo.FileName = "handbrakecli"
p.StartInfo.Arguments = "-i [source] -o [destination]"

[code].....

View 1 Replies

New Line Inside ToString Function

Sep 8, 2010

VB.NET 2008. How could I make a new line inside the ToString() Function that VB already have. How to do like a .WriteLine() but inside the ToString() function. In my case, this inside of a class of course. I don't know if you get me. All I want to do is to show a fraction in the normal way not using the slash(/). Showing the numerator on top of a line, and below it the denominator. This inside the VB pre-made ToString() function.

This is what I've tried;
Public Overrides Function ToString() As String
Return Me.numerator & "/" & Me.denominator
End Function
Output example: 2/3
But this is not what I want.

View 4 Replies

VS 2008 - Code Error On Tax Calculating Program - User Enters The Item Name And Amount Of The Item Purchased

Feb 9, 2010

So i've to write this program whose purpose it this:

Purpose: The user enters the item name and amount of the item purchased. The program calculates the tax for the item and the final total, and then displays these values. Tax on all items will be 7.75%.

And so far i've this code but it's not working:

' Program: Cash Register
' Author: Nidhi Shah
' Date: February 2, 2010
' Purpose: The Cash Register Window application will
' computer the tax and the final cost of a
' purchased item.

Option Strict On

Public Class frmCashRegister
' Tax per item - used in multiple procedures
Const _cdecTaxPerItem As Decimal = 0.0775D

[CODE]...

View 6 Replies

Reciept Printing - Form Which Consist - Item Code , Item Name , Item Price , Quantity Of Item

May 25, 2012

Regarding my college project. i'm working on a sales system . i have a form which consist of all the following information( item code , item name , item price , quantity of item ) which is display using a data grid . data input by user using text box and all this information will be stored in a database(sales database) i'm using ms access 2007. the grand total will be displayed in a text box . and amount paid will be input in a text box too , my major problem now is how to i create a reciept that will have all this information of the purcase. i have a reciept button . what the next step ? i dont have any idea how to get the reciept done.

Imports System.Data.OleDb

Public Class Form5
Dim con As New OleDbConnection

[CODE].......................

View 9 Replies

Translating Decompiled Code - Function That Accepts An Item Name Its Cost And Its Quantity

May 6, 2011

I was wondering if someone could translate this code into a more understandable code. It is suppose to be a function that accepts an item name its cost and its quantity. and adds one more array element to ."items" variable and assigns the given name and cost and quantity.

Public Sub AddItem(ByVal strName As String, ByVal dblCost As Double, ByVal intQuantity As Integer)
Me.items=DirectCast(Utils.CopyArray(DirectCast(Me.items,Array),New Purchase(me.itemsCount + 1)-1){}),Purchase())

End Sub

This is the translation i made but i don't think it is correct.

Public Sub AddItem(ByVal strName As String, ByVal dblPrice As Double, ByVal intQuan As Integer)
Dim items As Purchase() = Me.items
Dim itemCount As Integer = Me.itemsCount
For itemCount = 0 To items.Length - 1

[CODE]...

View 3 Replies

VS 2008 Code Not Executing In Right Order?

May 13, 2009

i seem to be having issues with my simple count down project. The count down work how I want it, there is also a pic of a rocket that move up when the count down button (Button4 - the form was set up in class as a quick example, so there was no need to name the buttons) is pressed. The problem is that the count down "10....1...Blast Off" shows after the rocket has moved up, I want the countdown text to show, then the rocket to move.The countdown is outputted to a ListBox.Here is my code thus far: (I have re-worked is a bit, starting to look messy)

[Code]...

I am not sure if I should be doing it as a function, that was just one of my attempts to get it to output everything in the right order.

View 8 Replies

VS 2008 Way Of Coding In Stead Of Writting Long Long Paragraphs

Sep 18, 2011

Is there a easer way of coding in stead of wrighting long long paragraphs like this in one line [code]All of this is on one line and i got lots of info to put down.."The game will begin on your 16th birthday with your mother waking you up. Today you are to go to the castle for the first time. Leave your bed and open your dresser for a Strength Seed. "

View 2 Replies

CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(My.Settings.homepage.ToString)

Nov 18, 2009

This gives me an error.CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(My.Settings.homepage.ToString)

View 4 Replies

2008 - Order Form Code Get MR/IR/999 - Stuck And Won`t Get Increase The Number

Apr 16, 2011

I`m make program for order form, I use order form code with name MR/IR/001, when I start Program It`s fine but when the order form code get MR/IR/999, It`s Stuck and won`t get increase the number, I want it the order form code go to MR/IR/1000, MR/IR/1001, MR/IR/1002 until 5000 how to get code work,

THIS THE CODE USING VB 2008 and database using MS access 2007

Dim strTemp As String = ""
Dim strValue As String = ""
Dim sql As String

[CODE]...

View 6 Replies

Visual Studio 2010 - Parse A Long Text Separated By "*"

Apr 14, 2011

I am trying to parse a long text separated by *. That text has to be shown like the second example. What is the simplest way of parsing this sample text in order to sort the text for easy reading.

[Code]...

View 3 Replies

VS 2008 - Use A Northwind Database To Display Customer And Order Information

Apr 20, 2011

I have to use a northwind database to display customer and order information. Populate a combo box with the CompanyName sorted in alphabetic order. Display the customer information in bound labels and the order information in a grid. For customers, display id,name,title,phone. For orders display the order id order date required date and shipped date. how to connect the access database file to vb.

View 3 Replies

Progressbar With Long Function

Mar 10, 2009

I have a situation like this:[code]This function takes several minutes. I do not have access to any kind of loop counter because the function is a big loop, but I do not want it to be done in the click event, I want the click event to call the function, as it does here. Is there any way to report the progress in a progress bar on the form with the button that called this function?

View 2 Replies

[2008] Display Text Item In Combobox By Selectedvalue Function?

Feb 4, 2009

i want to set the current displayed item in combobox by combobox.selectedvalue = valuehere is the code

Combobox.selectedvalue = value
rivate Function populateComboSupplier(ByVal supplierID As Integer) As Boolean
Dim readSupp As New SupplierCRUD

[code].....

View 1 Replies

Sql - Function Takes Long Time For Execution?

Jun 13, 2012

Actually, I am trying to find out whether the partno is existing in the database table or not and it takes long time in count = checkCommand.ExecuteReader statement

Public Function CheckProductNo(ByVal Partno As String) As Boolean
Dim count As SqlDataReader
Dim valid As Boolean = False
Using connection As New SqlConnection

[code]....

View 4 Replies

ASP.NET (VB) Performing A Long Function Asynchronously Without Blocking The Page Thread?

Jan 15, 2012

I've been reading up on asynchronous function / web pages for ASP.NET 3.5 (we're not using v4 yet) but the ones I've seen all focus on performing a background task but then still coming back to finish up and send the response, after the task is complete.

What I want to do is simply kick off the background task (in this case a call to a web service) but then return a response to the browser immediately - ie. without waiting for the asynchronous task to complete. I don't even need to know if it succeeds or not.What is the best way to do that? I can't seem to find examples of kicking off what you might call an "orphan" background task in ASP.NET.

I thought of doing it via a javascript Ajax call on the page I show to the user, but the information passed to the web service is sensitive, so that's out of the question. But that kind of illustrates what I want to do.

[ed] Another idea: Is there an event in the ASP.NET model I can use which occurs after the response has been sent to the browser and the connection closed? ie. So more processing can occur without the user waiting for it?

View 2 Replies

IDE :: Maintaining Array's Order When Deleting A Listbox Item

Jul 24, 2009

I have made an employee list and linked it to an Access database. The initial problem I was having is that in my program I had to link their ID's and names so if you click on an employee in the listbox, his or her's ID would automatically display in the textbox below. Since I did not know how to do so, I decided to make an array and store the ID and names separately while the listbox is being compiled. And so, the form became linked and adding became easy to code.But my problem came in deleting an employee. When deleting the name should be removed from the list, but this is where the order of the arrays messed me up. How do you maintain the order of the array? Here is the code I used. I dimmed 'count' as an integer and it is responsible for keeping that order.[code]You will see Staff_CodeTextBoxes etc. and info_Staff_CodeTextBoxes. etc.These text boxes (not visible to the user) are responsible for holding the data while the array takes the data from it, or adds it's own data to it.

View 4 Replies

Can Not Get New Order Button To Function

Nov 9, 2011

I am doing a project that multiplies quantities and prices, while keeping a running total, also will be able to click a new order button and start over. I can not get the new order button to function, we using functions and private classes. Here is the code, thank you for any input.[code]

View 6 Replies

E.HasMorePages - Written A Function That Will Plot Long Texts Onto Printer And Should Insert A New Page Everytime

Apr 30, 2011

I'm having issues with e.HasMorePages.. I've written a function that will plot long texts onto the printer and should insert a new page everytime yPos > PrintHeight

e.g.

Module Scope var i is the count

PrintPage
if i<=10

[CODE]...

I can certainly add pages from the printpage, but my function will plot characters individually onto the printer and will increase ypos at the end of the printers width.

View 10 Replies

Dim X As Object - Summarize The Long Code?

Sep 3, 2011

I want to summarize this code because it is too long:

[code]...

View 4 Replies

Making A Long Code Short?

Aug 1, 2009

im making a basic program, The relevant code is

SendKeys.Send("0000")
SendKeys.Send("{ENTER}")
Threading.Thread.Sleep(500)

but, i need to make it go from 0000 to 9999. but i don't wanna do 9999*3 lines of code. i need help. i got no idea about how to do this, i was trying to make my own program there would generrate the code for me, but did pretty much crash... so...

SendKeys.Send("0000")
SendKeys.Send("{ENTER}")
Threading.Thread.Sleep(500)

[code]......

View 19 Replies

VS 2008 ORDER BY That Does Not Order Correctly?

Jan 14, 2010

I have to order a table following a logical order but I cannot find the appropriate ORDER BY clause.To simplify I have 2 fields field1 and field2

1 record : field1 contains �2� and field2 contains �1�
2 record : field1 contains �1� and field2 contains �2�
3 record : field1 contains �2� and field2 contains �2�

[code].....

View 16 Replies

[VB 2008] Transform Code To A Function

Mar 10, 2010

How can I transform this code to a function (anyone can do it for me?)? Otherwise I have to use this long code again and again..

[Code]...

View 8 Replies

VS 2008 Cast, Convert, ToString - Which One To Use?

Nov 2, 2009

I've been programming in vb.net a lot for the last 9 weeks and I have just come across a lot of double functionalities (hope I used the right word for that).For instance, you can use CInt, CType, Directcast or Convert to turn something into a integer. (Directcast doesn't really belong in that line but whatever).

With calling methods you can do DoWork() or call DoWork()With returning values in functions you can do DoWork() = 3 or return 3 Why is this? Is it just to make the transition frm vb6 to vb.net easier? Or about giving the programmar a lot of options. I must admit I don't really like to have that choice, I am always in doubt whether I am using the right method .

View 11 Replies

Passing JavaScript Array Of Long To Code Behind?

Sep 7, 2009

I have returned object from signature device and when i make quick watch on it, it told me that its an array of long and when i pass it to web method in my code behind (vb.net) it gives me nothing. note: i'm using an activeX to capture the signature from the device.

this is javascript code :

function OnSave() {
var sign = document.FORM1.SigPlus1.SignatureString;
PageMethods.Save(sign);
}

this is my webmethod:

<WebMethod()> _
Public Shared Function Save(ByVal obj As Object) As String
Dim obj1 As New PFSIGNATURELib.SigniShellSignature

[code]....

View 1 Replies

Terminate Code That Takes Long In Program?

Oct 25, 2010

How to terminate function/code (not entire page) when it takes some time, for example, more than 1 sec?[code]...

I found the command "Server.ScriptTimeou", but it stops the entire page instead of one command.

View 2 Replies

Difference Between ToString And ToString()?

Dec 16, 2010

1. What's the difference between ToString and ToString()? (i do know that ToString method is to cast numeric values to string but don't know how to get it to work)

2. Why do i need XML comment feature? is it necessary?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved