devexpress CheckedComboBoxEdit.DataBindings connect to xpcollection - vb.net

I'm trying to connect xpcollection, below is xpcollection code I'm using:
Private Agent As New XPCollection(Of clAgent)(UOW)
I would like data from this collection to be visible in CheckedComboBoxEdit, I think it should be DataBindings, however it's not working, or I don't know how to work it out. Any ideas of how to add results from xpcollection to CheckedComboBoxEdit?
Thanks
Patryk

You need to use the RepositoryItemCheckedComboBoxEdit.DataSource property to assign a data source to CheckedComboBoxEdit.
Private Agent As New XPCollection(Of clAgent)(UOW)
CheckedComboBoxEdit.Properties.DataSource = Agent

Related

ClientCacheConfiguration is not saved to table

Was using CacheConfiguration in Ignite until I stuck with issue on how to authenticate.
Because of that I was starting to change the CacheConfiguration to clientCacheConfiguration. However after converting it to CacheConfiguration I started to notice that it
does not able to save into table because it lack of method setIndexedTypes eg.
Before
CacheConfiguration<String, IgniteParRate> cacheCfg = new CacheConfiguration<>();
cacheCfg.setName(APIConstants.CACHE_PARRATES);
cacheCfg.setIndexedTypes(String.class, IgniteParRate.class);
New
ClientCacheConfiguration cacheCfg = new ClientCacheConfiguration();
cacheCfg.setName(APIConstants.CACHE_PARRATES);
//cacheCfg.setIndexedTypes(String.class, IgniteParRate.class); --> this is not provided
I still need the table to be populated so it easier for us to verify ( using Client IDE like DBeaver)
Any way to solve this issue?
If you need to create tables/cache dynamically using the thin-client, you'll need to use the setQueryEntities() method to define the columns available to SQL "manually". (Passing in the classes with annotations is basically a shortcut for defining the query entities.) I'm not sure why setIndexedTypes() isn't available in the thin-client; maybe a question for the developer mailing list.
Alternatively, you can define your caches/tables in advance using a thick client. They'll still be available when using the thin-client.
To add to existing answer, you can also try to use cache templates for that.
https://apacheignite.readme.io/docs/cache-template
Pre-configure templates, use them when creating caches from thin client.

Active Directory - Create Computer into container with 'Everyone' ACL

I am currently still beginning to understand Active Directory, I am able to add domain groups into local administrator group but I would like to understand how to approach this : I need to create a computer into the right container in my domain, which I understand how to achieve this, but I do not understand how I can be able to achieve the 'Everyone' ACL whenever I create a new computer in the domain by code.
Note :
1. I am not asking for code, I want to understand how to achieve this so any guidance/articles will be greatly appreciated as I just seem to be unable to find any articles related to my case.
2. I am using Visual Basic to achieve this in Visual Studio 2008.
Thanks for any replies in advance, looking forward to learning this. :)
Edit 1 : Found several ways that might achieve this : powershell or group policy
I found an alternative for VB.net
The following Visual Basic example shows how to read a security descriptor on an object.
Imports ActiveDS
Imports System.Collections
Dim ent As New DirectoryEntry("LDAP://CN=ComputerName,OU=container,DC=domain,DC=com")
Dim sd As SecurityDescriptor = CType(ent.Properties("ntSecurityDescriptor").Value,SecurityDescriptor)
Dim acl As AccessControlList = CType(sd.DiscretionaryAcl, AccessControlList)
Dim ace As AccessControlEntry
For Each ace In CType(acl, IEnumerable)
Console.WriteLine("Trustee: {0}", ace.Trustee)
Console.WriteLine("AccessMask: {0}", ace.AccessMask)
Console.WriteLine("Access Type: {0}", ace.AceType)
Next ace
The following Visual Basic example shows you how to write a security descriptor to an object.
Import ActiveDS
Dim usr As New DirectoryEntry("LDAP://CN=ComputerName,OU=container,DC=domain,DC=com")
Dim newAce = New AccessControlEntryClass()
Dim usrSD As SecurityDescriptor = CType(usr.Properties("ntSecurityDescriptor").Value, SecurityDescriptor)
Dim usrAcl As AccessControlList = CType(usrSD.DiscretionaryAcl, AccessControlList)
newAce.Trustee = "Anything"
newAce.AccessMask = - 1
newAce.AceType = 0
usrAcl.AddAce(newAce)
usrSD.DiscretionaryAcl = usrAcl
usr.Properties("ntSecurityDescriptor").Value = usrSD
usr.CommitChanges()
You have to add reference into the solution. Add Reference --> COM --> Active DS Type Library

How do I use application settings to store MySQL database connection info?

I'm creating an in-house application and have always hardcoded the database connection string. However, this time I want to do something different and give the users the ability to enter the information from the application.
I figured out that I can store the variables in the Application Settings and call them from code, but I can't figure out how to call them within the connection string.
Here's the code:
Dim dbConn As New MySqlConnection
dbConn.ConnectionString = "Server=172.43.96.271;Port=3306;Uid=someone;
Password=theirpassword;Database=thedb"
Hope I explained myself well?
You can simply concatenate the string together, or better yet, use the String.Format method:
dbConn.ConnectionString = String.Format("Server={0};Port={1};Uid={2};Password={3};Database={4}", My.Settings.Server, My.Settings.Port, My.Settings.Uid, My.Settings.Database)
If you were using MS SQL, I'd recommend using the SqlConnectionStringBuilder class to do it, but since you're using MySql, it doesn't really apply. You may be able to use it anyway, though.
You would have to use User Settings for this.
And, if you want the users to input the separate parts of the connection string (Server, Post, Username, Password and DB), you would have to create a settings entry for each of those, and then construct the connection string from those values.
Here's a good article for this: User Settings Applied

Passing password at runtime

I inserted a bindingsource and then created dataset and tableadapter through it.
In my connectionstring, did not select to include sensitive data to it (password)
Now when the application runs, it says Invalid Password and crashes.
Off course it is what we expect.
Now my question is, I want my application to load password that I have passed in a variable e.g. vrMyPWD as string="abc123" before it loads
Me.TblInvoicesTableAdapter.Fill(Me.DbInvoicesDataSet.tblInvoices)
at from_load. So there is no error and application works normally.
Please guide.
Thanks
declare vrMyPWD as global string and set it Using HANDLE_CREATED event
Very easy:
TableAdapter.connection.connectionstring + = ";Password=abc123"

FileUploadDialogHandler()

I am trying to automate a web app which involves selecting an existing file using a fileuploaddialoghandler() method and entering the full path in the file name dropdown then Open click.
However, when I attempt this using this code
FileUploadDialogHandler fileupload = new FileUploadDialogHandler(#"C:\TIFFiles\Testtif.TIF");
//browser.WaitForComplete();
using (new UseDialogOnce(browser.DialogWatcher, fileupload))
{
newIee.Button(Find.ById("ctl00_WebPartManager1_FileUpload_FileBrowse")).ClickNoWait();
browser.AddDialogHandler(fileupload);
browser.WaitForComplete();
browser.RemoveDialogHandler(fileupload);
}
It does not work.
What else should I be doing?
Thanks much!
W
I just have one question about your code... What is newIee? I can't tell by looking at the code if newIee is attached to browser. Other than that, your FileUpdateDialogHandler should be fine.
If you can provide the code where you declare newIee, it might add me in determining if it's a factor causing your code not to work properly.