|
Fist: do you get the "Connection accepted" message?
If not your "Me.tcpIPAdresa" of "Me.brojPorta" might be wrong.
Second: please state what you've allready tried, what your steps where, test runs etc. - just posting a (not stand-alone) codeblock and beging for help will not work without further info.
Examples you will find in the MSDN documentation to TcpListener
|
|
|
|
|
Hello,
I am trying to come up with a way of securing controls inside of a VB.NET 2005 application (Window form). I have searched and found information but the resources seems to be all based on ASP.NET (Codeproject's article are also not useful enough, like http://www.codeproject.com/KB/vb/2gs_txtbx.aspx#add[^])
I have created database to store values for username and password. I have already did a user login which verify the username and password. I want to have two level levels of security. One that has limited access to certain forms(users) and another that has full access(admin). I want one user to be able to access a screen with controls such as data grid view but not be able to edit them. Is there any good concepts out there on how to manage this efficiently? Any help would be greatly appreciated.
Thanks,
telly
|
|
|
|
|
I tried to declare functions of DLL file in project directory with VB 2005/2008. However, I need to specify file path of DLL. Otherwise, VB cannot find DLL file when calling the function. Is there any other way I can make project directory default when loading DLL?
Current code:
Public Declare Auto Function CmodConnect Lib "C:\Visual Studio 2008\Projects\Cmod\Cmod.dll" _
(ByVal Address As Integer) As Boolean
Change to:
Public Declare Auto Function CmodConnect Lib "Cmod.dll" _
(ByVal Address As Integer) As Boolean
|
|
|
|
|
ADd the path to the PATH variable on your computer. But, really, the dll should just be local, that's the best way to do it.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
The DLL file is not a COM or assembly component. Thus, I could not use "Add Reference". The PATH might cause problem when moving to other computers. Is there other way to force VB to link the DLL file?
Thank you,
Steven
|
|
|
|
|
bj93081 wrote: The PATH might cause problem when moving to other computers
Absolutely - for deployment, the dll needs to be in the same folder as the exe, or a subfolder which you specify. That's kind of why I said that's the best way to go. Why would you want to put it elsewhere ?
Christian Graus - Microsoft MVP - C++
"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,
i use windows application I want validation to create texbox write arabic only
please send to me a sa
mple code
Ahmed hassan
|
|
|
|
|
You want your windows app textbox to accept only arabic characters ? I guess you need to work out their range in Unicode, and then handle the keypress event to reject keys not in that range.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Not sure if I can help but you might want to google a bit.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi all,
i have a System DSN connection where i have to create an exe to check a particular table in the database with some status.
can any body let me know.
thanks in advance
M.MohanVamsi
|
|
|
|
|
What have you tried ? Do you use google to look for information ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
i tried to look into google but i'm not getting proper stuff.
i already have a system dsn.
just i want to connect with visual basic and run some query on the tables
can you please let me know how to connect.
M.MohanVamsi
|
|
|
|
|
Do you have a connection string ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I suggest that you follow this tutorial through from the beginning.
The end of the tutorial introduces databases:
Clicketty
You always pass failure on the way to success.
|
|
|
|
|
Hello. I designed a scheduling application for my office in Visual Basic 2005 Express. It connects intermittently to an MS Access mdb database (on our office share drive) to populate datasets and make changes and updates to tables in the database. Occasionally it is used my multiple users at once but most of the time it is used by one user at a time. What baffles me is that I get concurrency exceptions even with one user. (As I had previously understood it - obviously incorrectly - concurrency errors were caused by two users trying to change the same row of data at the same time.) I'd really like to get to the root of what's causing these errors. It's not enough for me to Try - Catch these errors and display a messagebox; I'd like to understand what's causing the errors and handle them more intelligently.
In general, what could be causing single user concurrency errors? How can I effectively search for the cause of the errors? (It seems that they occur at very random times.) Any advice from someone who knows more about concurrency than me (or where could I learn more)? Thanks, all.
Regards,
Craig
"That rug really tied the room together."
modified on Thursday, December 20, 2007 12:05:22 PM
|
|
|
|
|
craigmg78 wrote: As I had previously understood it - obviously incorrectly - concurrency errors were caused by two users trying to change the same row of data at the same time.)
That's true - you got that wrong. A concurrency failure occurs when an application goes to update a row in a database and the data in that row has changed since the application read the row OR the application made a mistake in identifying the row to be updated. For instance, when your application gets a row from the database, it sees something like:
ID FirstName LastName PhoneNumber
1 Joe Schmoe 555-1212
Say you are trying to change the phone number. You make the change in the application and the app is trying to write the new data back to database. Well, id order to identify the record, the code is using an SQL query that looks something like this:
UPDATE ContactsTable
SET FirstName = 'Joe', LastName = 'Schmoe', PhoneNumber = '123-4567'
WHERE ID = 1 AND FirstName = 'Joe' AND LastName = 'Schmoe' AND PhoneNumber = '555-1212'
Notice that the WHERE clause in the SQL statement mentions all the fields in the table and gives the values of the fields as they are supposed to be now, when the application read this record. This is how the code matches up the record it intends to update with the record in the table. If any of these fields do not match, the record is not found, and hence cannot be updated. The "number of rows affected" by this SQL statement should return 1 if the change is successfully written.
If the "number of rows affected" comes back 0, or greater than 1, this throws the concurrency exception in your code. Now, what are the possible causes of "rows affected" returning a non-1 value?
1) The record in the database has been changed by an outside source. This is either another user updated the same record, the database changed the record in response to some other application, or some problem with the database.
2) The data in the WHERE clause of the SQL UPDATE statement is not correct. What the application read before is not what the app is now submitting in the WHERE clause to uniquely identify this record.
For example, your application read the record in the example above (1, Joe, Schmoe, 555-1212), but, for some reason, when it build the SQL statement to update the record with new data, the data it used in the WHERE clause doesn't match what it read. It might be doing something like:
UPDATE ContactsTable
SET FirstName = 'Joe', LastName = 'Schmoe', PhoneNumber = '123-4567'
WHERE ID = 4 AND FirstName = 'Frank' AND LastName = 'Schmoe' AND PhoneNumber = '555-1212'
Notice the ID and FirstName fields in the WHERE clause no longer match what was originally read. This too can cause a concurrency violation, without another user using the database.
modified on Thursday, December 20, 2007 2:01:13 PM
|
|
|
|
|
That has given me some real food for thought. Now I just have to hunt for cases in my code where I have done something like you mentioned! Thank you for your detailed response.
- Craig
"That rug really tied the room together."
|
|
|
|
|
hi,
i use windows application I want validation to create texbox write arabic only
Ahmed hassan
|
|
|
|
|
Hi,
I think if you will set the Font property of that particular textbox to Arabic font, then whatever text is entered in the textbox will be in Arabic only and you wont need to validate it.
Regards,
Ujjaval Modi
Manpower moves wrenches, horsepower moves cars, and the power of the mind moves the world.
|
|
|
|
|
please send to me code
Ahmed hassan
|
|
|
|
|
Please don't ask twice. Also, there is no code. DId you understand the answer ? I was wondering myself, if a computer is set up to be arabic, what other characters would you expect ? Or do you just mean to reject numbers and symbols ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
You already asked before. Don't keep asking the same thing over and over. It is rude.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
As the title says. I need to directly connect two computers or devices that have my software using IP addreses. And to share files between the two computers.
Example.
I select from a list IP address that I previously obtained, I connect to that IP adress and upload or download some files from it.
How to handle such a transfer?
Any ideas?
Thank you!
|
|
|
|
|
One machine must be running some kind of server to handle it's end of the file transfer and the other must be running a client that talks to that server.
There are a ton of different ways to do this, but to get any kind of an answer you're going to have to be more specific about what you're doing. Are you transferring files as part of a peer-to-peer chat application? Is this a central server that's going to hold these files? Can you use a normal FTP server as part of your app? Do you know anything about writing app's that use sockets?
|
|
|
|
|
Good afternoon All
i have an Application in an Multiuser evironment, i have a Concurency Problem. i would like someone to Explain to me how to handle Concurency using thread, i would like to lock the Update Function when one of users is updating the records and unlock it when the process is done . here is an example of my code
Public Function SaveProperties_Lis(ByVal dsDAta As PropDAL.Dssearchlis) As PropDAL.Dssearchlis
Dim ws As PropDAL.Properties
Try
ws = New PropDAL.Properties
'check the Business Rules
Me.CheckRules_Lis(dsDAta)
'Updating the dataset
dsDAta.EndInit()
ws.UpdateLis_search(dsDAta)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return dsDAta
End Function .
i have this Function in BLL(Business Logic Layer). i want to lock it , when another user is using it.
The Bll is running on the Client machine and its a DLL that is deployed with the Application. i need to trap the Concurency situation in the BLL. The code above is retreaving the data from the DAL(data Access Layer), so the BLL will create an object of a DAL and use the DAL functions, and the Client application will call the BLL for service by creating an object of BLL and use the methods of BLL that will use the methods of DAL, i have not prevented Concurency to a database,and thats what i want to do. i want to know how to achieve this in a multi user Environment.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|