|
Mohammed Amine wrote: in the first time you use your programme it is a normal thing that you the database you work in is empty that mean it has no rocords yet , & that also mean that you will recuperate just emptiness & this throws a debuguage
i want to know how to act with this case what is the code i should add to ma application to stop this bug ??
Do you mean you have a problem with NULL value. If so, try to read this document.[^]
|
|
|
|
|
HI ,
please i have finished ma application in vb.net & i want to deploy it can you tell me how ?? actualy i did a deployement for but i need you if you know to tell me what is the role of a register key in deployement & how can i attach a database with code & this is the interesting part
well here i will make things more clear to let you understand what i want :
i have a database an sql database "i'm working with SQL server 2000"
i knew how to integrate the two files of the database Mdf & the Ldf one in ma application
now i want how can attach this database to the server just with code
i have the two files Mdf & Ldf & i want to attach them to the server just with code can you tell me how please ???
thank you very much
try to be good if you can't be the best
|
|
|
|
|
Example your application name your.exe and your database name your.mdf
If you add file name your.exe to application folder you can see file your.mdf with it.
................
|
|
|
|
|
I have created a program that will access a webpage online using the built-in web browser in visual basic 2005 express, but if the user is NOT online, they get an ugly "Page Cannot Be Displayed" page. I want to be able to validate that the user is online so that I can redirect them to a custom page that I will store on their hard drive if necessary.
I am fairly new to vb, and would appreciate any help I can get.
Thanks in advance!!
|
|
|
|
|
I got the following code from http://www.devx.com/vb2themax/Tip/19159[^]
I haven't tested it, but it appears to be just a matter of making sure the wininet.dll is in the system directory and then calling IsConnectedToInternet function from your code. If it returns true you're connected, if false you're not. They you just change the location based on the response.
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef _
lpSFlags As Long, ByVal dwReserved As Long) As Long
Const INTERNET_CONNECTION_MODEM = 1
Const INTERNET_CONNECTION_LAN = 2
Const INTERNET_CONNECTION_PROXY = 4
Const INTERNET_CONNECTION_MODEM_BUSY = 8
' return True if there is an active Internect connection
'
' optionally returns the connection mode through
' its argument (see INTERNET_CONNECTION_* constants)
' 1=modem, 2=Lan, 4=proxy
' 8=modem busy with a non-internet connection
Function IsConnectedToInternet(Optional connectMode As Integer) As Boolean
Dim flags As Long
' this ASPI function does it all
IsConnectedToInternet = InternetGetConnectedState(flags, 0)
' return the flag through the optional argument
connectMode = flags
End Function
|
|
|
|
|
I'm really new to vb and don't understand this code or how to use it... Does anyone out there know how I can impliment this into my program... Thanks.
|
|
|
|
|
Hi all,
I have an app which uses async socket and using state.sb.Append(Encoding.Default.GetString(state.buffer, 0, bytesRead)) to get resultant string and Dim byteData As [Byte]() = System.Text.Encoding.Default.GetBytes(data) to convert the string into bytes
. My problem is this String has Non Ascii characters and a two byte header appended. Is there a decoder and Encoder that can give me back the exact message back when I parse through the message. message from source is like.
..0421.>D.... ...B..."1643054521000000140120000000045000000502171701000002171701050208120216601190100C00000000C00000000064305480000000075656810000007430541000000007Tdi Mkt Circle Tdi GH7160202053716C00000000000000440210100000007565020000000205021717010000043054800000000000000000000000000000000000C00000000C00000000160101121000006165015211201210144002000058$.......EBGATMS ZIMSWITCH 00000200DebitGroup 30
But when decoded with the above I dont get the full message and when i try and convert it back to it original state I dont the correct stream.
Please assist
|
|
|
|
|
I dont't want anyone close my process,what can I do?
|
|
|
|
|
You can run but you cannot hide
If a user has sufficient access, he or she can terminate any running process.
There's nowhere to hide.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Billypon wrote: I dont't want anyone close my process
If this is possible, we won't be able to clean a virus.
|
|
|
|
|
Dear All,
I am a beginner of VB and I am trying to create a Confirmation Message for a particular checkbox.
The scenario is that: suppose I have two (2)checkboxes and one Submit button.
If I just want to display a confirmation for the checkbox #1 only. The user changes the status on checkbox 1 (on/off), then click on the Submit button, this confirmation will display.
Would you please help me out.
I would appreciate it.
|
|
|
|
|
I'm not sure I understand the question completely. If you want to always display a confirmation message if it is checked, that's pretty straight forward. If you want to display a confirmation message if the value has changed you will have to create a variable to record if it has changed or not. I would use a boolean value which is originally set to false and is set to true only in the CheckChanged event of the checkbox in question. The code for the confirmation box would look something like this:
Dim result As New DialogResult<br />
result = MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)<br />
Select Case result<br />
Case Windows.Forms.DialogResult.Yes<br />
'Code for Yes action<br />
Case Windows.Forms.DialogResult.No<br />
'Code for No action<br />
End Select
Of course, you have a lot of options here. Use the intellisense help to see the different combinations of buttons and other options that you can use.
This code was written in Visual Studio 2005, but if you use a different version it should still be very similar. Hope this helps.
|
|
|
|
|
Dear Kschuler,
I am so glad to receive a message from you. However, let me clear my problem so that you can get it fully.
Suppose a user is modifing a form that have 2 checkboxes (checkbox1 and checkbox2) and 1 submit button.
If a user change (check or uncheck) the checkbox1, then a confirmation will display.
That is my problem, and I am using VB6. Would you please help me out.
I would appreciate your help very much,
Tram88
|
|
|
|
|
Okay, how about this:
Private boolChanged As Boolean
Private Sub Form_Load()
boolChanged = False
End Sub
Private Sub btnSubmit_Click()
Dim result As VbMsgBoxResult
If boolChanged = True Then
result = MsgBox("Are you sure?", vbYesNo, "Confirm")
Select Case result
Case VbMsgBoxResult.vbYes
'Code if user selects Yes
Case VbMsgBoxResult.vbNo
'Code if user selects No
End Select
Exit Sub
End If
'Code if no changes were made to check boxes
End Sub
Private Sub Check1_Click()
boolChanged = True
End Sub
Private Sub Check2_Click()
boolChanged = True
End Sub
|
|
|
|
|
Dear Kschuler,
Would you please confirm the codes that you wrote above, Should I put it into the .acsx or ascx.vb file? I would appreciate your potential helps very much.
Tram88
|
|
|
|
|
Sorry...I assumed that you were creating a standard Windows Forms Application. This code will not work for a web project, and I am not sure I can help with a VB6 web project. I typically use VS2003, 2005.
To perform your task in a web project I would probably set a hidden control on the page to record if the checkbox changes. Hidden controls look like this:
<input id=hidChanged runat=server type=hidden />
(You will need another hidden control to store whether the user selected yes or no on the confirm if that determines which code to use later in the code behind) Then I would attach a javascript function to the button which would check the hidden variable and display a javacript confirm if needed. The javascript would look something like this:
function CheckIfChanged()<br />
{<br />
if (hidChanged.value <> "")<br />
{<br />
Result = confirm("Are you sure?");<br />
if (Result)
{<br />
form1.hidResult.value = "Y";<br />
return true;<br />
}else{
form1.hidResult.value = "";<br />
return false;<br />
} <br />
}<br />
}
The javascript would need to be connected to the button's on click event.
Then of course, you need to set the hidden variable when ever a user clicks the checkbox. You can do this in code behind if it's okay to do a postback everytime the user clicks the checkbox, or you could use more javascript.
I'm not sure how much of this applies to VB6, but I hope it will help you or at least give you some ideas to work from. Sorry I couldn't help you more.
|
|
|
|
|
Dear Kschuler,
Thank you very much for your potential helps.
Tram88
|
|
|
|
|
How would you add preview support to a screen-saver you write in VB.Net?
|
|
|
|
|
I am looking to for Visual Basic code (using Visual Studio 2005 and a Visual Basic Smart device Pocket PC 2003 project option) that will allow me to open the serial port of a Pocket PC. I need the code that will open and then read GPS data when the built project is deployed to the Pocket PC. The GPS uses COM1 at a baud rate of 4800. I have only been able to find third party addons and these tend to be expensive. As a pensioner I cannot afford to buy these addons and also wish to do it without any extras if this possible so I do not have to rely on third parties. I would be very grateful if someone can email me with the answer to my problem (datacore@nildram.co,uk)
Gordon
|
|
|
|
|
How can i copy file from a server?
This is without any kind of sharing.
i used this:
System.IO.File.Copy("soucePath", "detpath")
but return this message:
Could not find file "sourcepath"
and in the file system the file is in here.
thank for all!
Kosta
|
|
|
|
|
The credentials under which you are running must permit access to the source path - whatever its form.
This implies some sort of sharing even if it is at the administrator level (i.e. the 'hidden' C$, D$ etc admin shares).
Having said that, how about showing us the exact code you are using (use copy/paste) and the values of any variables used in the copy function?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
hi . i wnat make combobox like treeview and set datasource to a table Products(
123
|
|
|
|
|
How to disable button in the ContentMenu for
certain user.
I mean, lets say in the login form i have this
particular user ADMINISTRATOR, MANAGER, & EXECUTIVE.
For the user list button i only want to allow
ADMINISTRATOR to view it.??
by the way, thanks a lot for the [View Tab] help.
The code works...
|
|
|
|
|
You need to create roles and demand permissions. Create a Principal permission based on their user and then demand it.
Dim myPermission1 as new PrincipalPermission("ADMINISTRATOR", Nothing)
Dim mypermission2 as new PrincipalPermission("MANAGER", Nothing)
Dim myPermission3 as new Principalpermission("EXECUTIVE", Nothing)
Dim myPermission as PrincipalPermission
Try
myPermission.demand
button1.enabled = true
Catch
'If they're not in the ManagerGroup it won't run the enabled = true command
End Try
|
|
|
|
|
My application runs excel 2000 as an automation server. Problem is I cannot get excel to release from the windows processes after the application finishes. I've done internet searches but have not found any thing that works. Any help would be greatful. Thanks.
|
|
|
|