|
sjs4u wrote: str = "select id,name from table where id="+id
id is int
name is varchar
It gives the Invalid CastException:-Conversion from string "select id,name" to type 'Double' is not valid.
What data type is str?
|
|
|
|
|
Like I mentioned before I am using Vista DB at work and there is a sql built in, as my experience with databases is limited to the intro course in college. I have a db with 2 cloumns, one for serial numebrs labeled, serial_number, and one for what we call kanban_serial. I found it easier to use the underscore instead of using the quatation mark in my statement. So here is what I have, hope it helps:
Private Sub find(ByVal sn As Integer)
Dim sqlSN As String = "SELECT * FROM 'serial number data' WHERE 'serial_number' = & 'sn'"
I also use a section to delete a record from the db and here is what I have:
Dim d_SN As Integer
d_SN = CInt(txt1.Text)
Dim delete_SN As String = "DELETE FROM serial_number_data WHERE serial_number = " & d_SN
Brian
|
|
|
|
|
I am developing a system in VB.NET 2008 with an SQL Server 2005 Standard Edition backend, which will require several reports to be written. Some of these reports will be quite complex.
I have never used SQL Server's Reporting Services, but was wondering if I should use them for the reports as apposed to Crystal Reports 2008. I have no objection of learning SQL Server Reporting Services as I will need to learn them in the mid-term future away.
With Crystal, I would be inclinded to create SQL Server Stored Procedures to colate the data for the reports anyway.
Any advice would be appreicated.
Thanks
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
I am using VB 6.0 on windows XP support Arabic Language, I set controls to RighTtoLeft mode and it works correctly in my computer, but after making package (with package & deployment wizard), when I set up it on another computer which has not MSOFFICE before, the application is convert to LeftToRight!, and if I setup MSOFFICE before or after setting up my package, this problem will be solved.
It would be appreciated if you tell me how I can prevent appearing this problem.
Regards
hassan seif
|
|
|
|
|
hello everybody,
i m using cr 8.5 version and vb 6.0 i have created all report file with cr and i m using dynamic code for call it from vb.
i did not attecth it to my project externally i.e. from Project menu -> add crystall report 8.5 .bcoz call it dynamically.
the problem is when i m pacakging it i.e. with package and deploy wizard it will giving me error like "out of stack"
how solve this problem. ?
is it necessary to add all report in to my project.
Thanx in advance.
|
|
|
|
|
hi all.
first is my application read and write some information from registry.
the application run smoothly in admin mode in both (xp and vista)
but the problem is, if the account type is guest the my application fails to run.
i have tried to make manifest file but it won't work at all.
is their any other way to allow my application in guest account with administrator rights.
thanks to all in advance.
|
|
|
|
|
Yup there is...
I think the problem why your application does not run in 'user mode' is that the given user doesn't have sufficient rights to read or write the registry.
First of all you should ask yourself if reading & writing to the registry is really needed. There are several other perfect ways to store application data etc... Have a look at Isolated Storage[^] for example
Second there are a few different permissions required for different 'sections' of the registry. For example HKEY_LOCAL_MACHINE requires admin rights... You may have a look at HKEY_CURRENT_USER. Of course you cannot store 'system wide' information there....
|
|
|
|
|
XP doesn't have this ability. The user has to launch the application using RunAs.
I would suggest, next time, you develop your application under a normal User account, the same as the type that's going to run your application, and not as an administrator. This forces you to take into consideration the restictions the user has to access certain things, like the HKEY_LOCAL_MACHINE hive in the registry.
|
|
|
|
|
Hello,
I have two screens and one - the wrong one - is still active or set to primary screen respectively.
Is there any possibility of changing this?
Thanks in advance.
|
|
|
|
|
...and this has what to do with VB.NET??
Start/Settings/Control Panel/Display is what you're looking for. What you do in there depends on the video drivers you have installed. Consult the documentation that came with your video card.
|
|
|
|
|
... of course it has ...
If I'm posting a question in this forum. It should be clear that I don't want to have an instruction to do this with XP-/graphic tools. Isn't it?! So it would be nice, if you have any idea to solve my problem by using VB.NET.
Thanks.
|
|
|
|
|
I'm developing a simple IVR systemin vb.net using Microsoft's Speech SDK 5.1 and TAPI. My challenge is to integrate these two such that i recongise speech through a telephone line. Can someone please help.. Sample source code would be greatly appreciated.
Nyaguire
|
|
|
|
|
For such a generic query, this[^] is about as close as your going to get for an answer.
|
|
|
|
|
Hi Friends,
This is Aruna.I am working on .Net.I want to know something about SCP(Secure Copy Protocol).Past i am using FTP for file trasfer from one system to another system.Now i have to run with SCP .I don't know how to run that tool. Please How to run SCP with SSH in Windows Application.Can you give the suggestion to do this application.I am WindowsXp.
Aruna.K
|
|
|
|
|
You're going to have to find a 3rd party library that handles this for you, such as this[^]. The .NET BCL doesn't have any support for this built in.
|
|
|
|
|
Hi,
I've narrowed down a memory leak in my application to a single Sub, however, I can't figure out what's doing it. Whenever this Sub is called (SelectedIndexChanged), my memory usage grows by ~100 kb and doesn't go down, according to Task Manager.
Here's my code:
Note:
The following names are Global Variables:
appSelPath
appSelName
appSelAlt
appSelPos
appSelID
canEnable
beenFound
And yes, I need all of these variables as they are used in many other methods within my application.
<br />
Dim selectedText As String = ""<br />
If lbApps.SelectedItems.Count = 1 Then<br />
btnLaunch.Enabled = True<br />
<br />
pbSel.Image = ilApps.Images(lbApps.SelectedIndex + 1) 'lvApps.SelectedItems(0).ImageList.Images(selImg)<br />
<br />
selectedText = lbApps.SelectedItem.ToString<br />
btnLaunch.Text = "Launch " + selectedText<br />
btnMove.Text = strMoveText.Replace("|", selectedText)<br />
'Add Application Routine<br />
If selectedText <> "Add Application..." Then<br />
'set app selected path<br />
For i As Integer = 0 To appListing.Count - 1<br />
Dim lineData() As String = appListing.Item(i).ToString.Split("|")<br />
If selectedText = lineData(0) Then<br />
appSelPath = lineData(1)<br />
appSelName = lineData(0)<br />
If lineData.Length = 3 Then<br />
If lineData(2) = "True" Then appSelAlt = True<br />
Else<br />
appSelAlt = False<br />
End If<br />
End If<br />
Array.Clear(lineData, 0, lineData.Length)<br />
lineData = Nothing<br />
Next<br />
<br />
Dim enableIt As Boolean = True<br />
' Dim appPos As Integer = -10<br />
For i As Integer = 0 To appLaunched.Count - 1<br />
Dim lineData() As String = appLaunched.Item(i).ToString.Split("|")<br />
If lineData(1) <> "wait" Then<br />
If appSelName = lineData(0) Then<br />
enableIt = False<br />
If CInt(lineData(1)) > 0 Then<br />
appSelPos = CInt(lineData(1))<br />
appSelID = CInt(lineData(2))<br />
canEnable = True<br />
End If<br />
End If<br />
End If<br />
Array.Clear(lineData, 0, lineData.Length)<br />
lineData = Nothing<br />
Next<br />
<br />
ContextMenuStrip1.Enabled = True<br />
btnLaunch.Enabled = True <br />
lbScreens.SelectedItems.Clear()<br />
If enableIt = False Then<br />
lbScreens.Enabled = True<br />
btnMove.Enabled = False<br />
canEnable = True<br />
beenFound = True<br />
Else<br />
lbScreens.Enabled = True<br />
btnMove.Enabled = False<br />
beenFound = False<br />
canEnable = False<br />
End If<br />
End If<br />
End If<br />
selectedText = Nothing<br />
I have no idea what's wrong. I've looked at this chunk of code for hours now, and it doesn't seem like I'm making any unusual calls to anything.
Any help is appreciated.
Thanks,
Mitch F
|
|
|
|
|
Mitch F. wrote: Note:
The following names are Global Variables:
appSelPath
appSelName
appSelAlt
appSelPos
appSelID
canEnable
beenFound
Nasty....
What makes you think this is leaking memory ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hmm... so even if global variables are handled correctly, they will still cause an extremely large growth in memory consumption? Is there any more efficient way to carry variables from one sub to another?
|
|
|
|
|
I see no reason for this to leak memory. I assume you really mean it uses more memory than you would like. No object in this method can leak memory.
Globals won't leak, they are just a poor design. Yes, you can pass variables as parameters, or use delegates if classes need to communicate when a value changes.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Thanks for the responses.
I've created a quick application (using one textbox and one button) to see if global variables are eating up memory and not releasing it, and that seems to be the case.
<br />
Public Class Form1<br />
Dim globalString As String = ""<br />
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged<br />
globalString = TextBox1.Text<br />
End Sub<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
TextBox1.Text = ""<br />
globalString = Nothing<br />
End Sub<br />
End Class<br />
When I add text to the global variable, the memory starts to get eaten pretty quickly, but when I click the button to set the variable to Nothing, the memory still isn't released, but more memory is taken.
Thanks,
Mitch F
|
|
|
|
|
Well, if that's true, that's one more reason not to use globals. However, I'd be inclined to suggest that your methods of watching memory usage are flawed. Do you watch the memory in the task manager ? That's not really accurate.
Also, when I run this, the extra memory usage is minimal. Also, global is not a global, it's a member variable. To be the .NET equivelant of a global, it would need to be static.
Based on the minimal memory usage in the test I just did, I think you're worried about nothing, and certainly should do some reading regarding how the garbage collector works.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
TaskManager ais about the worst tool you can use to see how much memory your app is using. Why??
This is because TaskManager isn't showing you the memory your app is using. It's showing you how much memory is reserved by the .NET CLR Virtual Machine that is running your app. If your app releases managed memory back to the runtime, the runtime holds onto it (as seen by TaskManager) because it's not being released back to Windows. The runtime holds onto it to fill future requests for memory by your application faster. If Windows needs the memory back, the .NET CLR will release any it memorys it has in reserve back to Windows.
If you really want to see how much memory your app is using, use the Performance Monitor and the .NET CLR counters to monitor your app. Task Manager isn't show you how much memory your app is REALLY using.
|
|
|
|
|
Mitch F. wrote: The following names are Global Variables
No, they are not. There are no global variables in VB.NET.
Mitch F. wrote: my memory usage grows by ~100 kb and doesn't go down, according to Task Manager.
The Task Manager doesn't show how much memory your application uses, it shows how much memory the memory management has allocated. When memory is released back to the memory management, it doesn't get released to the system unless the system needs it.
Mitch F. wrote: Array.Clear(lineData, 0, lineData.Length)
lineData = Nothing
Doing things like that only uses CPU time, it doesn't release any memory earlier.
Clearing the array is pointless. When the array is no longer used, the references that it contains are no longer concidered, so all the strings also counts as unused. Actually, clearing the array will keep it in memory longer than if you didn't.
Setting a reference to Nothing only serves a purpose if you later in the code actually check for that Nothing value. Clearing references for the purpose of releasing memory has no effect at all.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi everyone!!
i have a huge problem and i've been working out this one for a long time now. i need your help..
does anyone knows how am i supposed to set the database connection for access if the target computer (the one i am about to deploy the application) is not connected on the network? i have created some applications and executables before and it had perfectly worked because i am using a database that is stored in a server computer and i just configure the connection string based on the shared folder.
my current project work well with that too but i need to install this application to a laptop which is to be brought anywhere (of course) and is not connected on the network. how am i supposed to do this..? i badly need your help guys...
btw, i am using visual studio .net 2002 and my database is in ms access.
thanks a lot in advance!!!
crookshanks
|
|
|
|
|
If your DB is access, then it's just an MDB file, deploy it with your app.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|