|
Thanks Dave..
I was thinking of that too as an alternative. But I just don't know what's that for and how to use it. i just saw it in the MSDN Support.
|
|
|
|
|
If you don't know what a For/Next loop is, you REALLY need to pick up a beginners book on VB.NET. A For/Next loop is one of those very basic concepts they teach on the second day of class in any course involving VB.
|
|
|
|
|
Im having issues using PrincipalPermission to authenticate a Windows Domain account. I need to be able to see if a user belongs to a domain group even if they are not the account currently logged into the workstation. Here is the scenario:
A set of users will belong to a group. It is called "group1" . I am attempting to run this code to check if they belong to this group. If so - let them continue. If not, then catch the error. Here is the problem. When I (myaccount) is logged into the machine it authenticates fine for me. It won't authenticate for someone who is a member of Group1 while I am logged into the machine. Even if the other user is a member of group1 and has Administrator rights such as "Otheraccount" does below. The workstation this is running on has the following in the Administrators group:
DOMAIN\myaccount
DOMAIN\otheraccount
DOMAIN\Group1 (myaccount and otheraccount are members of this group)
I am running this code:
'***********************************************************
Dim SecurityCheck As New PrincipalPermission("DOMAIN\"& strUserName, "DOMAIN\Group1")
Dim strError As String
Try
SecurityCheck.Demand()
Catch errormessage As System.Exception
strError = errormessage.Message
If strError = "Request for principal permission failed." Then
MsgBox("You are not a local administrator. You do not have rights to access this software. If you need access, please contact your manager.")
Me.Close
Exit sub
Else
msgbox(strError)
End If
'***********************************************************
Any suggestions? I have tried this as well with the same results:
Dim SecurityCheck As New PrincipalPermission("DOMAIN\"& strUserName, "Administrators")
|
|
|
|
|
Don't post the same question again. You already continued this on a previous thread. Have some patience. We all have real jobs to do and only answer questions here on a volunteer basis when time permits.
|
|
|
|
|
Hi, I have an application that reads data from a text file into a datatable in the format required for a table in an SQL SErver 2005 database.
My question is, having filled the table 'manually' in memory, how do I connect that table to the database and insert the information? Obviously I can do inserts for each row in the datatable, but there are around 30,000 rows so I am looking for a faster method as this can take some time.
I understand that the dataadapter requires the insert command etc but 1) how do I get the table into the adapter and 2) does it know that these are new records?
Any help would be very geatly appreciated.
David Loring
!! Keep Music Live !!
|
|
|
|
|
I wouldn't use a DataAdapter or DataTable . I'd just read the file and create the INSERT statements directly and push it through a SqlCommand object. You can put multiple commands into a SqlCommand object - It is just a string of SQL after all.
|
|
|
|
|
You may also want to checkout the SqlBulkCopy[^]class if you're using the .NET Framework 2.0 or above. Check to see if it'll fit your requirements first.
|
|
|
|
|
hi friends,
i developed a application in vb.net and sql server. i have to give a demo for that , there my client will use it for a week. my problem is i want to block my application after a week, and also dont allow to reinstall the application,
does anybody have any idea .. please share...
regards
|
|
|
|
|
if (DateTime.Now > _dateToStopWorking) then Close()
Something like that will work fine.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks for the reply,
i already had the same idea, but we have to think about installation , if application is already installed at any time , it should not allow to install it again, (ie, uninstall current & then reinstall again)
how can block this..
|
|
|
|
|
One way is to hard code a date in your application and every time the application get's focus check on the date.
I used it once for a similar situation, but i did it with an encoded end date in the form of serial number. So my application decoded the serial number, that i saved in the Application's Properties and validated the date. If the date was passed, a msg box was shown and the application quited.
Hope that it gets you inspired, if someone else have nice ways, leave a reply.
|
|
|
|
|
thanks for the reply,
i already had the same idea, but we have to think about installation , if application is already installed at any time , it should not allow to install it again, (ie, uninstall current & then reinstall again)
how can block this..
|
|
|
|
|
I Known that there is an application called "IEActivityMonitor" can do this well and the source code is in "http://www.codeproject.com/useritems/IE_Activity_Monitor.asp"
However the source code is an old C# version. When I use Visual studio 2005, the source code is converted and do not work.
I hope someone can help me to write an VB version with the same functions.
Help + Help
|
|
|
|
|
In fact, if you put an IE control in your app, and handle it's events, the events will get fired for any instance of IE running on the PC. So, that's all you need to do.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Wow - is IE a static class then?
You always pass failure on the way to success.
|
|
|
|
|
I don't know how it's set up.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am a biginner to VB.Net 2003.
I am warking with VB.Net 2003 and Sql server 2000. I want take back up my database every day. How can I do this one. Can any send Coding for back up.
|
|
|
|
|
Use This query
dim _ssql as string
_ssql="BackUp Database myDbase to disk = 'D:\Back\myDbase.bak' with
init", clientCon "
Here myDbase is the Database name and clientCon is the connection object
|
|
|
|
|
Hi,
I have developed an Add-In for VS 2005 using VB.NET. I use the following code to add commandbar to the toolbar of the Studio.
cbrCmdBar = CType(_applicationObject.Commands.AddCommandBar(strCBarName, vsCommandBarType.vsCommandBarTypeToolbar), CommandBar)
Now I have following 2 questions:
1. The toolbar I created as part of add-in is floating rather than being part of the existing toolbar of the Studio IDE.
2. My Addin toolbar has 5 buttons. It works ok when the first time I open Studio. When I close Studio and re-open, I find that one more instance of my add-in gets created. The first toolbar (due to the first instance of IDE) does not show any buttons and the second toolbar has all buttons. This way if I close and re-open the Studio, say 10 times, I get 10 instances of my add-in toolbar. Of these 10, only one has my 5 buttons and the rest all instances are without buttons. It seems that when the IDE is closed, my add-in toolbar is not getting destroyed.
Any reason for this behaviour?
|
|
|
|
|
I've never written a VS add-in so I'm no expert. It sounds like you code is hanging on to an object that it should have destroyed or Disposed of, but never did, or didn't do properly on shutdown.
|
|
|
|
|
Hi Dave,
I have the same feeling that the object is not getting destroyed though I have set the object to Nothing. Any other reason?
Regards.
vj
|
|
|
|
|
No idea. Like I said, I've never written an Add-In. I don't even know if there is an event you have to handle to get signaled, or if you must implement IDisposable, or something else...
|
|
|
|
|
In a windows form... I'm using WebBrowser control for navigate but i need put the credentials proxy. How can i introducing there?
Thanks
|
|
|
|
|
There's no built-in way to do this. The WebBrowser control is pretty much a wrapper for an Internet Explorer window. The WebBrowser control will use the same settings as define in the Tools/Internet Options menu of Internet Explorer.
|
|
|
|
|
hey there !
pls save me now.
i want to run this code below at run time : (after we load form already)
1. i have one text box that contain code below
dim Str$
for i as integer=0 to 5
for j as integer=0 to 5
for k as integer=0 to 4
str=i+j+k
listbox1.items.add str
next
next
next
2. one listbox for get the result
3. one command button for click to execute code in the textbox
i wait for all of ur reply 2me na . thanks in advance
regard from
spider anatha
|
|
|
|