|
yes, my I have a room Class and my room number is the primary key in my DB, i have a little trouble becose i only make webs with , php,Ajax,Javascript ETC but this project needed to be a desktop application.
Thank you so much for the help, this is a very cool site and and responses are very fast different from sites in Spanish.
|
|
|
|
|
yes , i think in this case, i have 3 floors in this hotel, so each button name is like f1_100, f1_101 ,only make 3 case with a string search ,then , with this search get the total room name ho is the primary key from my DB.
|
|
|
|
|
Hi,
0.
I can't find a question in there.
1.
please use PRE tags to show code (i.e. <PRE>some code</PRE>) for better readability
2.
no need for New Button, you do not intend to create yet another button!
Dim boton As Button = CType(sender, Button)
3.
You now have the Button, you can do anything you like with it, such as:
someTextBox.Text = boton.Name & " was pressed"
|
|
|
|
|
First off, please forgive me if this is in the wrong section. I'm not sure if the probelm is my VB.Net code or my understanding of installers.
I've written a Windows Forms Application which stores it's preference settings in an XML file. I'm having problems with the file not being written to the directory I intend.
I want to write the XML file in the application folder C:\Program Files\MyApplication , but when I install and then run my application it writes the XML file in C:\Users\MyAccount\AppData\Local\VirtualStore\Program Files\MyApplication (This folder does not contain a copy of the executable, and is empty apart from the files written by my application when it runs).
I've made the following declarations in the application for the file name and path:
Private strApplicationPath As String = Application.StartupPath
Private strPreferencesFileName As String = "\Preferences.ini"
I have my application preferences stored in a DataSet called dsPreferences , and use the following code to write the file:
dsPreferences.WriteXml(strApplicationPath & strPreferencesFileName, XmlWriteMode.WriteSchema)
To help me sort out what's going on I've also added a lable to the form called lblPath to display the file name and path:
lblPath.Text = strApplicationPath & strPreferencesFileName
When I do a Release Build, and run the executable everything seems to work fine. The XML file is written in the same directory as the executable ie
C:\Projects\MyApplication\bin\Release
and lblPath.Text also displays
C:\Projects\MyApplication\bin\Release
HOWEVER!
I then use "Inno Setup 5" and "ISTool" to create an installer, and then install the application to
C:\Program Files\MyApplication .
Now when I run the application the XML file is written to
C:\Users\MyAccount\AppData\Local\VirtualStore\Program Files\MyApplication
instead of
C:\Program Files\MyApplication
where the executable is, even though lblPath.Text still shows that
strApplicationPath & strPreferencesFileName = C:\Program Files\MyApplication
!?!
The same issue is happening with the SqlCe database file for the application.
- What is this VirtualStore?
- Why is the XML file written there when I've been reasonably explicit that it should be stored in the same folder as the executable?
- How can I make sure the file gets written to the correct folder?
Thanking you in advance.
Paul
|
|
|
|
|
|
I think you hit the nail on the head there!
Thanks!
|
|
|
|
|
Hi all,
I have a strange problem:
Dim X As Single = 50
Dim Y As Single = 1000
Dim Z As Single = X \ Y
Why Z return me 0.0 as result of operation instead that 0.05?
If X is 100, then the result is correct (0.1).
I also tried to dimensione variables as Double, and to use Double.Parse instruction, but without resolve the problem.
All this is in a VB .Net Compact Framework routine.
Surely the problem is a "false" problem, but now I have a momentary "mind vacuum".....
Thanks for help.
modified on Sunday, January 17, 2010 12:32 PM
|
|
|
|
|
Single is a single precision float (from MSDN). I think this should explain. You can use decimal and I think it would give correct result.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi D@nish,
Single is a single precision float, but normally it returns decimal numbers.
I tryed to use Decimal type (return 0D value), but the problem is not resolved yet.
Here seems that the result is strangely cutted after the first decimal number.....
|
|
|
|
|
You're using the wrong slash. The Forward Slash, /, will give the correct result. The Backslash, \, does integer division.
|
|
|
|
|
Thanks Dave,
Without your help I risked to spend one week to try to resolve a false problem, and with no warranty to solve it in one week!
|
|
|
|
|
GENIUS
I couldn't work out why it wasn't happening!
Although you could have been a bit of a smartarse over that, it was nice to see you just pointed out what others failed to see!
------------------------------------
No Good Deed Goes Unpunished Clare Boothe Luce
|
|
|
|
|
Hi All,
I am looking for source codes/ .dll files which I can use in my project to create stylish buttons/Forms/Controls. Can someone suggest something on this?
Regards
R.S.
|
|
|
|
|
|
This is the first time, Iam trying to print the crystal report other than crystal report viewer..
Is it possible...?
Any Sample Codes?
Thanks
|
|
|
|
|
Paramu1973 wrote: Is it possible...?
AFAIK no!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes it's possible.
Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
'Populate your report data etc.
If PrintDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
rptDocument.PrintOptions.PrinterName = PrintDialog.PrinterSettings.PrinterName
rptDocument.PrintToPrinter(PrintDialog.PrinterSettings.Copies, False, 1, 1)
End If
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I don't want users can choose any tab when they click on tabheader.How to do this?Please help me!!!!
|
|
|
|
|
Here is a C# code that would do a similar thing. Changing it to VB should not be a big task IMO.
bool CanSelect = false;
void tabControl1_Selecting(object sender, TabControlCancelEventArgs e) {
e.Cancel = !CanSelect;
CanSelect = true;
}
Now, set the CanSelect variable to true when you want the selection to happen.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
The VB.Net for d@nish's code might be something like:
Private Sub TabControl1_Selecting(ByVal sender As Object, ByVal e As System.Windows.Forms.TabControlCancelEventArgs) Handles TabControl1.Selecting
e.Cancel = Not CanSelect
End Sub
i.e. If CanSelect is True then .......... Don't cancel the TabControl1_Selecting event
If CanSelect is False then ......... Do cancel the TabControl1_Selecting event
|
|
|
|
|
Hello,
I am trying to make a small app to interact with Tumblr.com.
The API information page is here:
http://www.tumblr.com/docs/api
It outputs XML which i am not familiar with....yet.
What i want to know is how would i tell a vb app to download this output and what sort of variable should i keep it in to work with? Is string appropriate?
The ANZAC
|
|
|
|
|
Imports System
Imports System.IO
Imports System.Net
Imports System.Xml
Module Module1
Sub Main()
'Address of URL, just a random user
Dim URL As String = "http://harumacchi.tumblr.com/api/read"
' Get data
Dim client As WebClient = New WebClient()
' Read an print to console
Dim reader As StreamReader = New StreamReader(client.OpenRead(URL))
Dim str As String = ""
Do While reader.EndOfStream = False
str = reader.ReadLine()
Console.WriteLine(str)
Console.ReadKey()
Loop
' load as document
Dim xmldoc As XmlDocument = New XmlDocument()
xmldoc.Load(client.OpenRead(URL))
For Each node As XmlNode In xmldoc.ChildNodes
Console.WriteLine(node.Name)
Console.ReadKey()
Next
' read as xml
Dim xmlreader As XmlTextReader = New XmlTextReader(client.OpenRead(URL))
Do While xmlreader.Read()
If xmlreader.NodeType = XmlNodeType.Element Then
Console.WriteLine(xmlreader.LocalName)
Console.ReadKey()
End If
Loop
End Sub
End Module
I personally prefer XmlDocument but you could also use XmlTextReader.
|
|
|
|
|
Thanks. I'm not sure exactly how to work with this though.
If you are willing to help more here I have further questions. Alternatively I can make a new thread.
For instance, how would i then get certain bits of information about each post?
I gather the For Each loop can be used to probe the nodes, but how would i find the id or link for each post using this loop?
|
|
|
|
|
I'm a bit lost now.
Don't you understand the tumbler/api xml or are you confused with the XmlDocument class?
|
|
|
|
|
I don't really understand how to use the xml document, how to look through the nodes etc and extract the information i want.
|
|
|
|