|
Hi Dave,
Thanks for your continuous responses... I can can now print PDF files...
Thanks a lot...
|
|
|
|
|
hi. how can I convert a string to integer? I'm doing a program in VB were you are required to input a
mathematical formula in a single input box and value each of the integer. But when I use the Left command,
the formula of the textbox are converted into string type and won't compute the value as in the formula
indicated. I really need your help. thanks..
|
|
|
|
|
There is nothing built into VB.NET or the .NET Framework that's going to evaluate expressions typed into a textbox. You have to create your own expression parsing engine to break the input down into something you can do the math on, piece-by-piece. Google for "Reverse Polish Notation" for an intro to expression engines. There are certainly other implementations to do this, but RPN is good place to start.
|
|
|
|
|
Hi,
If U want to convert text in to integer then simply U can use it:-
<br />
dim s as string<br />
dim i as integer<br />
<br />
s="200"<br />
i=val(s) 'This function converts the string in integer<br />
<br />
<br />
Best Of Luck
|
|
|
|
|
Did you read the OP's question? He said the text box contains a "mathematical formula".
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|
|
Have you considered looking at this[^] article to get an understanding on evaluating formulae in a textbox. I know it's in C#, but using a tool like Reflector it's relatively simple to revert the IL into VB.NET.
|
|
|
|
|
I'm doing a project entitled "SMS Environment for Bus Time Arrival". What it means is that a user can SMS to the server asking for what time will the bus arrive at that particular bus stop. I've done the SMS part but I do not know how to extract the bus information from the database and how to create the database. Hopefully someone will be able to help.
Mistreated.
|
|
|
|
|
Mistreated wrote: I do not know how to extract the bus information from the database and how to create the database.
Since you don't have a database, that's going to be pretty difficult.
Mistreated wrote: Hopefully someone will be able to help.
There isn't enough information to tell you much of anything other than gather the requirements for your database. What pieces of information are you going to track? How do these piece relate to each other?
|
|
|
|
|
If you are part of the SBS team, you will be provided the information on how to retrieve the information from their server.
If it is a school project, you wont be able to get the actual information from SBS. What you can do is mock the bus arrival information (DateTime, Bus number, ETA of certain bus stop) and put them in a database, if the main focus of the project is the SMS part, not the arrival prediction part.
|
|
|
|
|
Can you help me with the codes of how to extract the information from the database? Lets say i mock all the bus information such as the arrival time and the location of the bus stop.
Mistreated
|
|
|
|
|
Some ideas which may help !!!
Bus stop data: Stop name is not unique. There's probably 100's of 'High street' . Also there will be a bus stop on the other side of the road. Each stop must have unique ID.
Time tables : In most cases are not 'rich' enough and the published one's are full of cryptic codes like FO - Fridays only. Even worse will be the subscripts (1) - 'Only runs on market days'
Bus number: Every bus Co. will have a 1 service. So in even in your area there may be several same number buses. Make a Service number unique example FR001 - for the First service number 1.
Routes - You will need a route. Time tables mostly give 'Timing points' leaving out intermediate stops. Don't assume each Bus no 1 goes the same route. Think about school runs.
You will need to simplify this very complicated situation but highlight in your project where you have simplified and why..
So you should have a minimum of three relational tables Bus stop, Bus, Route.
Each query will take the form of "What is the next bus stopping at this bus stop" or "What is the time of the next number 1 at this bus-stop"
Hope this not to confusing.
Bestbefore
|
|
|
|
|
What is the difference between typed and untyped data sets?
Which one is better to use?
I think I should use typed datasets. Am I right.
|
|
|
|
|
AAGTHosting wrote: What is the difference between typed and untyped data sets?
Read[^]
|
|
|
|
|
Yup , can anyone elaborate the difference between TYPED and UNTYPED DAtasets?
ADVANTAGES and DIsADVANTAGES
any working example of how they work?
:- Rashid Ali -:
|
|
|
|
|
I have been using Visual Basic.Net 2003 to develop a program. I switched to using Visual Basic 2005 Express. I set up a data adapter in 2003 and when I converted the program to 2005 the data adapter did not work. Then I deleted the data adpater and when I tried to find a data adapter I could not find one?
Do we use data adapters in Visual Basic 2005?
What is the difference between connecting to a database, setting up a data adapter and data set between VB 2003 and VB 2005.
When I created a data set in VB 2005 I noticed a file named dataSet1.vb that had a class named dataset1 in it. I don't think that VB 2003 created a dataSet class.
Does anyone know where there is a document describing how to set up a data adpater and data set in 2005?
|
|
|
|
|
AAGTHosting wrote: What is the difference between connecting to a database, setting up a data adapter and data set between VB 2003 and VB 2005
It's no different, in code. If you're using the designers to do it, the 2005 designers do things a bit differently than 2003, favoring the use of the newer TableAdpater class.
Personally, I just about never use the designers to do my database work. I code my Data layers almost entirely by hand.
Seriously, if you want to learn how to fix problems like this, you MUST know how the controls and classes work in your code and not let the designers generate the "magical code" for you.
Dim conn As String = "...connection string..."
Dim comm As String = "SELECT field, field, field FROM table WHERE expression"
Dim da As New SqlDataAdapter(comm, conn)
Dim cb As New SqlCommandBuilder(da)
Dim dt As New DataTable
da.Fill(dt)
|
|
|
|
|
What is the purpose of the data Set class that gets generated when you create a data set?
Also, how do I create a data adapter? Does the data adapter get created automatically when creating a data set.
Do you normally only create one data set in a program or do you create multiple data sets?
Now, I do have several different tables. I have login tables, teachers tables and student tables.
|
|
|
|
|
How to import a MFC/C++ DLL into VB.NET 2005?
Network Development Kit 2.0
http://www.codeproject.com/internet/ndk.asp
I want to use this dll..
|
|
|
|
|
You can do this using P/Invoke. Click[^]
|
|
|
|
|
Hi,
I have a excel sheet, in that the fields are:
Name,EmployeeID,Address,Email.
Sourabh,757,New Bombay,something@something.com
I have a C1.Win.FlexGrid in which I have put the same columns in this grid with one more colum in the starting as Select(Boolean).
This is the code that I have written.....
<br />
Dim ofd As New OpenFileDialog<br />
Dim dgtemp As C1.Win.C1FlexGrid.C1FlexGrid<br />
Dim fn As String = ""<br />
Dim sheetname() As String<br />
<br />
ofd.AddExtension = True<br />
ofd.DefaultExt = ".xls"<br />
ofd.Filter = "Microsoft Excel Workbook(*.xls)|*.xls"<br />
ofd.ShowDialog()<br />
fn = ofd.FileName<br />
txtFile.Text = fn<br />
dgtemp = New C1.Win.C1FlexGrid.C1FlexGrid<br />
<br />
sheetname = dgtemp.LoadExcelSheetNames(fn)<br />
dgtemp.LoadExcel(fn, sheetname(0), C1.Win.C1FlexGrid.FileFlags.IncludeFixedCells)<br />
Thje bold part of the code is giving error as:
"Failed to open storage file."
Help...
Thanks and Regards,
|
|
|
|
|
You're going to have to go to ComponentOne's site for support[^] on this. It's functionality specific to their control.
|
|
|
|
|
Hello,
I have checked out the code at my end. It seems to be working fine. If the issue persists, I
would suggest you to contact at the following email addresses for further assistance.
support@componentone.com
Regards,
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Hi,
That is solved, another problem now.
Eg: I have a flexgrid with two columns(Select as boolean and Name as string) in which in the column of name I already have my name, now if i again upload a excelfile which has my name, in the datagrid my name should come checked.
How do I do that. The thing which I have already done is as below:
It will take some time for you to read this, but please read as I am stuck in a quick sand.
Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpload.Click<br />
Dim filename As String<br />
Dim od As New OpenFileDialog<br />
Dim SheetName() As String<br />
Try<br />
<br />
od.AddExtension = True<br />
od.DefaultExt = ".xls"<br />
od.Filter = "Microsoft Excel Workbook(*.xls)|*.xls"<br />
od.ShowDialog()<br />
filename = od.FileName<br />
SheetName = dgtmp.LoadExcelSheetNames(filename)<br />
dgtmp.LoadExcel(filename, SheetName(0), C1.Win.C1FlexGrid.FileFlags.IncludeFixedCells)<br />
<br />
Dim dgCol As C1.Win.C1FlexGrid.Column<br />
For Each dgCol In dgtmp.Cols<br />
dgCol.Name = dgtmp.Rows(0)(dgCol.Index)<br />
Next<br />
<br />
dgtmp.Cols.Add()<br />
dgtmp.Cols(dgtmp.Cols.Count - 1).Name = "SEL"<br />
dgtmp.Cols(dgtmp.Cols.Count - 1).DataType = System.Type.GetType("System.Boolean")<br />
<br />
objEms.RetrieveSearchData("FIS104", "BANK_CODE='" & BankCode & "'", "", sCompany, sPlant, dsRet, Nothing)<br />
If Not IsNothing(dsRet.Tables(0)) Then<br />
If dsRet.Tables(0).Rows.Count > 0 Then<br />
CLEARDATE = dsRet.Tables(0).Rows(0)("CLEAR_DATE")<br />
WITHDRAWLS = dsRet.Tables(0).Rows(0)("WITHDRAWLS")<br />
DEPOSITS = dsRet.Tables(0).Rows(0)("DEPOSITS")<br />
CHEQUENO = dsRet.Tables(0).Rows(0)("CHEQUE_NO")<br />
DESCRIPTION = dsRet.Tables(0).Rows(0)("DESCRIPTION")<br />
Else<br />
ShowMessage("Format not Defined", 30)<br />
End If<br />
End If<br />
<br />
Dim dgRow As C1.Win.C1FlexGrid.Row<br />
For Each dgRow In dgtmp.Rows<br />
'If dgRow.Index > 0 Then<br />
If dgtmp.Rows.Count - 1 > 0 Then<br />
With dgBankReco<br />
<big>Dim curRow As Integer = .FindRow(dgRow(CHEQUENO), 0, .Cols("CHEQUE_NO").Index, False, True, False)</big><br />
If Val(.Rows(curRow)("DEBIT").ToString()) = Val(IIf(IsNothing(dgRow(DEPOSITS)), 0, dgRow(DEPOSITS))) And Val(.Rows(curRow)("CREDIT").ToString()) = Val(IIf(IsNothing(dgRow(WITHDRAWLS)), 0, dgRow(WITHDRAWLS))) Then<br />
.Rows(curRow)("SEL") = 1<br />
.Rows(curRow)("CLEAR_DATE") = dgRow(CLEARDATE)<br />
dgRow("SEL") = 1<br />
End If<br />
End With<br />
Else<br />
dgtmp.Row = 0<br />
dgtmp.Rows.Fixed = 1<br />
End If<br />
Next<br />
<br />
<br />
Catch ex As Exception<br />
dsRet = Nothing<br />
End Try<br />
End Sub
The code in bold throws an exception as :
"Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index"
-- modified at 7:08 Thursday 22nd November, 2007
Thanks and Regards,
|
|
|
|
|
Using a propertygrid control i show my object properties to set and get.
Using attribute properties like i show below, i can control Category, Description, even particular selection mode using TypeConverter() attribute.
<<DescriptionAttribute("Set if mailing is enabled"), _<br />
CategoryAttribute("Mailing")<br />
GetType(ComboProperty)>> _<br />
Public Property IntercambioIn()<br />
...
I need to read a password string, and i can't show password chars like '*'.
Does exist any attribute to show the setting using password char ('*').
Regards
|
|
|
|
|
You can't do it in properties alone. You'd have to create your own custom property editor[^].
Scratch that. You CAN do it with a property. Look up the PasswordPropertyTextAttribute class.
<PasswordPropertyText(True)> _
Public Property Password() As String
Get
Return _password
End Get
...
End Property
|
|
|
|