|
Actually I was wondering if instead of deleting or appending(adding to) to the database file, I could overwrite(replace) whatever data was in the database?
|
|
|
|
|
Hi
I have two dropdowns in one .aspx page. First is all the states in US and another is for Cities in respective state (initally it is disabled). The data for States and Cities is coming from database and I am binding that in codebehind.
Cities dropdown gets enabled after state selection. For populating cities based on state selection, I want to do a client side operation, not the server side.
Using VB.NET, Javascript.
Please suggest any code example to acheive this. Thanks
PJ
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
Your question would be better handled in the ASP.NET Forum.
Your solution lies entirely in JavaScript. ASP.NET is only used for generating HTML for a browser. If you were to do this entirely in VB.NET, selecting the state would require a round trip to the server.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
well - i have a problem with screenshotting and remoting.
what i do:
my server-application has an hashtable where it stores the client-objects and a pictureBox.
the client-object owns the function _captureScreen:
Public Function _captureScreen() As Image Implements IClient._captureScreen
Dim getScreenShot As ScreenShot
'myParent is the mainForm from which the client-object was created
myParent.status.Text = "Screenshot called"
myParent.Screen.Image = CType(getScreenShot.CaptureScreen(),System.Drawing.Bitmap)
Return CType(getScreenShot.CaptureScreen(),System.Drawing.Bitmap)
End Function
The class ScreenShot simply catch a bitmap of the actual screen. i got the code from the net:
Public Class ScreenShot
Private Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (ByVal
lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As
String, ByVal lpInitData As String) As Integer
Private Declare Function CreateCompatibleDC Lib "GDI32" (ByVal hDC As
Integer) As Integer
Private Declare Function CreateCompatibleBitmap Lib "GDI32" (ByVal hDC As
Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
Private Declare Function GetDeviceCaps Lib "gdi32" Alias "GetDeviceCaps"
(ByVal hdc As Integer, ByVal nIndex As Integer) As Integer
Private Declare Function SelectObject Lib "GDI32" (ByVal hDC As Integer,
ByVal hObject As Integer) As Integer
Private Declare Function BitBlt Lib "GDI32" (ByVal srchDC As Integer, ByVal
srcX As Integer, ByVal srcY As Integer, ByVal srcW As Integer, ByVal srcH As
Integer, ByVal desthDC As Integer, ByVal destX As Integer, ByVal destY As
Integer, ByVal op As Integer) As Integer
Private Declare Function DeleteDC Lib "GDI32" (ByVal hDC As Integer) As
Integer
Private Declare Function DeleteObject Lib "GDI32" (ByVal hObj As Integer) As
Integer
Const SRCCOPY As Integer = &HCC0020
Private oBackground As Bitmap
Private FW, FH As Integer
Public Function CaptureScreen() As Image
Dim hSDC, hMDC As Integer
Dim hBMP, hBMPOld As Integer
Dim r As Integer
hSDC = CreateDC("DISPLAY", "", "", "")
hMDC = CreateCompatibleDC(hSDC)
FW = GetDeviceCaps(hSDC, 8)
FH = GetDeviceCaps(hSDC, 10)
hBMP = CreateCompatibleBitmap(hSDC, FW, FH)
hBMPOld = SelectObject(hMDC, hBMP)
r = BitBlt(hMDC, 0, 0, FW, FH, hSDC, 0, 0, 13369376)
hBMP = SelectObject(hMDC, hBMPOld)
r = DeleteDC(hSDC)
r = DeleteDC(hMDC)
oBackground = Image.FromHbitmap(New IntPtr(hBMP))
Return CType(oBackground, Image)
End Function
End Class
now, as soon as i call the client-function "_captureScreen" in my server-object:
Public Function _getClientScreenShort() As Image Implements
IServer._getClientScreenShot
Dim user As IClient
Dim capturedScreen As Image
'_clients is the hashtable
For Each user In _clients.Values
Try
capturedScreen = user._captureScreen
Catch e As Exception
Me._schoolMain.Info.Text = "Exception in Screenshot: " & e.ToString
End Try
Next
Return capturedScreen
End Function
now the following happens:
at client-site the status-text "screenshot called" is printed.
but after this, nothing happens. the picturebox of the client application stays empty.
the server-application even hangs up. (is a thread needed here???)
could someone help me out of my mess?
i hope i explained it understandable.
if not, just ask for more code or explaination.
thanks to all who took the time to read my thread.
greetings-
tom
|
|
|
|
|
Using VB.Net, I am able to set the CurrentCell in DataGrid.
I don't know if it is the CF or the control, but it will not hightlight the cell.
Any ideas?
Canada has 6 zones, none of which are erogenous.
|
|
|
|
|
can anybody show me how to use the MScomm ???
"_____ ______"
|
-_ _-
-______-
|
|
|
|
|
I haven't found any tutorials using MSCOMM, but with the VB.NET Resource Kit, downloadable here[^], there comes a free .NET comm library from Sax, complete with docs and samples.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi!
i am creating an XML document which keeps the record
of each client information. my XML document looks like this.
How can i add a new client? i am able to make updates to existing ones.
please give code.
thanks
vineet
<?xml version="1.0" standalone="yes"?>
<config>
<client name="Cadbury">
<mcastg>223.223.223.223</mcastg>
<port>4000</port>
<path>D:\</path>
<repeat>
</repeat>
<spawn>
</spawn>
<ttl>2</ttl>
<profile>Custom</profile>
<custom>
<bw>23</bw>
<dgsize>512</dgsize>
</custom>
</client>
<client name="dabur">
<mcastg>222.23.23.23</mcastg>
<port>3333</port>
<path>d:\</path>
<repeat>5</repeat>
<spawn>5</spawn>
<ttl>4</ttl>
<profile>High</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="Vineet Inc">
<mcastg>222.23.43.43</mcastg>
<port>5555</port>
<path>e:\</path>
<repeat>
</repeat>
<spawn>
</spawn>
<ttl>
</ttl>
<profile>Custom</profile>
<custom>
<bw>213</bw>
<dgsize>384</dgsize>
</custom>
</client>
<client name="ICICI">
<mcastg>244.244.224.2</mcastg>
<port>54334</port>
<path>e:\hello</path>
<repeat>10</repeat>
<spawn>45</spawn>
<ttl>4</ttl>
<profile>Low</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="Vikram">
<mcastg>223.33.56.234</mcastg>
<port>5433</port>
<path>d:\vineet</path>
<repeat>
</repeat>
<spawn>
</spawn>
<ttl>
</ttl>
<profile>Custom</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="SBI">
<mcastg>234.45.56.23</mcastg>
<port>4000</port>
<path>c:\</path>
<repeat>3</repeat>
<spawn>4</spawn>
<ttl>4</ttl>
<profile>Custom</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
</config>
|
|
|
|
|
Hello,
When I am executing this form load event its giving me overflow error on the line of OwnerhWnd = GetWindow(Me.hWnd, GW_OWNER)
I have declare the apis in one general module as below.
Declare Function ShowWindow Lib "User" (ByVal hWnd As Integer, ByVal nCmdShow As Integer) As Integer
Declare Function GetWindow Lib "User" (ByVal hWnd As Integer, ByVal wCmd As Integer) As Integer
please help me to fix this problem.
Sub Form_Load()
Const SW_HIDE = 0
Const GW_OWNER = 4
Dim OwnerhWnd As String
Dim ret As Integer
' Make sure the form is invisible:
Form1.Visible = False
' Set interval for timer for 5 seconds, and make sure it is enabled:
Timer1.Interval = 5000
Timer1.Enabled = True
' Grab the background or owner window:
OwnerhWnd = GetWindow(Me.hWnd, GW_OWNER)
' Hide from task list:
ret = ShowWindow(OwnerhWnd, SW_HIDE)
End Sub
Thanks
Murtuza patel
|
|
|
|
|
Dont use Integers when getting Handles from Win32, use IntPtr's instead:
Declare Function ShowWindow Lib "User" (ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Integer
Declare Function GetWindow Lib "User" (ByVal hWnd As IntPtr, ByVal wCmd As Integer) As IntPtr
GetWindow will return a Handle to a window or will return IntPtr.Zero for a failed call. If the return is IntPtr.Zero, then use GetLastError to find out why the call failed, if you need to.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dear Dave,
I have tried the program as you mentioned. But now there is new error is comin "user-defined Type not defined"
Plz help me to fix this problem.
actually i used these api function in a module and from there i am using it in form load event. I tried to use these functions in main form also but same error is coming where should i defined these functions and constant.
Thanks
Patel Murtuza
|
|
|
|
|
patelmurtuza wrote:
new error is comin "user-defined Type not defined"
I have to see your code. This message doesn't give me enough information to see what's wrong. It would appear that something isn't typed correctly, because the same Declare's work for me. I'd have to see your declares and the code where your getting the error.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Dave,
Have a Good Day.
Thanks for your help. I am sending you the complete code which I used to hide my app from the task manager. in form load i used the following code.
Sub Form_Load()
Const SW_HIDE = 0
Const GW_OWNER = 4
Dim OwnerhWnd As String
Dim ret As Integer
' Make sure the form is invisible:
Form1.Visible = False
' Set interval for timer for 5 seconds, and make sure it is enabled:
Timer1.Interval = 5000
Timer1.Enabled = True
' Grab the background or owner window:
OwnerhWnd = GetWindow(Me.hWnd, GW_OWNER)
' Hide from task list:
ret = ShowWindow(OwnerhWnd, SW_HIDE)
End Sub
in module I used the following declarations.
Declare Function ShowWindow Lib "User" (ByVal hWnd As Integer, ByVal nCmdShow As Integer) As Integer
Declare Function GetWindow Lib "User" (ByVal hWnd As Integer, ByVal wCmd As Integer) As Integer
Sub main()
Form1.Show
End Sub
when i declare the function as intgptr its not coming in refence. Should I have to give some special refence to get the Intgptr type decleration. right now the error is coming like userdefined not defined and if i make it as integer then the error Over Flow coming.
Please help to fix this problem or give me any other way to hide my VB6 app from task manager task list.
|
|
|
|
|
First, if your using VB6, in your declares, you have to change the Integer references to Long . VB6 doesn't support the IntPtr type. That's VB.NET...
Declare Function ShowWindow Lib "User" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Declare Function GetWindow Lib "User" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dear Dave,
Thank you very much for your quick response. But I am now getting new error as "File not found :User" at line of below code
OwnerhWnd = GetWindow(Me.hWnd, GW_OWNER)
Please I wanna get rid of this problem. Or else can you give any other way to make my vb application hidden from the task manger task list.
I want to make my application running in startup but I dont want that any one can stop my application while restarting computer before it started by stopping the app from the task manager.
Thanks
Mr. Murtuza Patel.
|
|
|
|
|
hi!
can anyone tell me how i can add a form to a windows service project that can make configuration changes to the windows service.
please let me know. thanks
regards
|
|
|
|
|
Well i know that this is not exactly VB.Net realted but because my idea is to use VB.Net i'm gonna post it here...
I'm gonna create a POS program for 3 branches of the company i work for... the thing is that they want to have only 1 DB on the Headquarters, and have all the computers get connected and disconnected to it to update Inventory, Sales, Etc, my question is... what will be the best approach to this?? how can i make the application to work disconnected ( in case that internet connection is lost ), there are any articles or examples or anything around the net that can help me to get some more ideas about what will be the best approach???
Thanks.
Alex.
|
|
|
|
|
There is really no one way to do it. All I can say is do a bunch of research on ADO.NET, disconnected record sets, design patterns, POS Systems, accounting practices, ...
This is all off-the-shelf standard accounting software that's been done over and over again for years. There is nothing special about your requirements that isn't standard in these applications. Just curious...But why not buy an off-the-shelf solution for your accounting? When you consider that this is going to take you 6+ months to design, write, test and implement even a simple system, wouldn't it be cheaper to pay the vendor than to pay you?
On top of that, any accounting mistakes made by your software can easily put the liability on you. Are you insured?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am running Visual Basic V6.0, and wish to take the current system time and store it in milliseconds into an 8-byte value for another system to use it. All the information I can find talks about converting into seconds, i.e. UTC, or getting the number of milliseconds since the machine was last booted up.
All I want is something that will give me the time expressed in milliseconds. I suppose I could just get the time in seconds and convert to milliseconds via * 1000, but that would not be exact.
Can anyone help me out on this one.
Thanks,
Simes
|
|
|
|
|
VB6 doesn't return the time using a milliseconds field, so you'll have to call into the Win32 API to get the time.
GetLocalTime[^] will get the system time in the local timezone.
GetSystemTime[^] will return the system time in UTC.
Both of these functions will require you to pass in a SYSTEMTIME[^] structure (ByRef) to get the time out of the function. The actual return value will tell you if the call failed or not.
The declare for both functions:
Declare Sub GetLocalTime Lib "kernel32" Alias "GetLocalTime" (lpSystemTime As SYSTEMTIME)
Declare Sub GetSystemTime Lib "kernel32" Alias "GetSystemTime" (lpSystemTime As SYSTEMTIME)
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
So I presume then that to get the SYSTEMTIME structure into the 8-byte data type, I will have to convert the SYSTEMTIME structure to a FILETIME structure and then convert that into the 8-byte data type that I wish to use. Is that correct?
|
|
|
|
|
That's right. Now all you have to do is make sure that the receiving system gets the bytes in the right order.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can anyone explain to me, What I need to do to create a data dictionary? The following is from the help section of Advantage. I don't know how to implement this into VB.Net code in my ASP.Net project.
Creates a data dictionary.<br />
<br />
Syntax<br />
UNSIGNED32 AdsDDCreate( UNSIGNED8 *pucDictionaryPath,<br />
UNSIGNED16 usEncrypt,<br />
UNSIGNED8 *pucDescription,<br />
ADSHANDLE *phAdminConn );<br />
<br />
Parameters<br />
pucDictonaryPath (I) Full file path of the data dictionary to create. <br />
<br />
usEncrypt (I) A non-zero value will cause the data dictionary data<br />
file to be encrypted.<br />
<br />
pucDescription (I) An optional description of the database in the data <br />
dictionary. If NULL, no database description is <br />
stored in the data dictionary. The database<br />
description can be added or changed later with <br />
AdsDDSetDatabaseProperty.<br />
<br />
phAdminConn (O) Returns a database administrative connection handle <br />
if the data dictionary is created successfully.<br />
<br />
Example:<br />
Create a data dictionary without encrypting the data dictionary data files, and then add a table to the database.<br />
<br />
AdsDDCreate( "n:\\MyData\\myData.ADD", 0, "This is the database of my tables and indexes.", &hDD );<br />
AdsDDAddTable( hDD, "Customer Information", "n:\\MyData\\customer.ADT", ADS_ADT, "customer.adi;customer2.adi",<br />
"This table contains information on all customers." )
Thanks in advance.
Beginner in VB and ASP.Net
|
|
|
|
|
hi
i am writing an application which maintains records of several clients. Each client has different settings. This is maintained in a XML file. When the user wants to update the data of a particular client changes have for that client.
this is what my XML document looks like.
<?xml version="1.0" encoding="UTF-8"?>
<config>
<client name="Cadbury">
<mcastg>222.23.342.1</mcastg>
<port>2222</port>
<path>c:\</path>
<repeat>4</repeat>
<spawn>4</spawn>
<ttl />
<profile>Custom</profile>
<custom>
<bw>1200</bw>
<dgsize>1024</dgsize>
</custom>
</client>
<client name="dabur">
<mcastg>222.23.432.23</mcastg>
<port>3333</port>
<path>d:\</path>
<repeat>5</repeat>
<spawn>5</spawn>
<ttl>4</ttl>
<profile>High</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="Vineet Inc">
<mcastg>222.23.43.4323</mcastg>
<port>5555</port>
<path>e:\</path>
<repeat>10</repeat>
<spawn>1</spawn>
<ttl>4</ttl>
<profile>Low</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="ICICI">
<mcastg>223.533.456.234</mcastg>
<port>54334</port>
<path>e:\hello</path>
<repeat>10</repeat>
<spawn>45</spawn>
<ttl>4</ttl>
<profile>Low</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="Vikram">
<mcastg>223.533.456.234</mcastg>
<port>5433</port>
<path>d:\vineet</path>
<repeat>10</repeat>
<spawn>45</spawn>
<ttl>4</ttl>
<profile>High</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
</config>
say i want to edit the settings for ICICI, how do i do from within the executing program. please give proper code.
Thanks
|
|
|
|
|
Dim ds As New DataSet
Private Sub btnGetData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetData.Click
ds = New DataSet
ds.ReadXml("c:\test.xml")
DataGrid1.DataSource = ds
End Sub
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
ds.WriteXml("c:\test.xml")
End Sub
|
|
|
|
|