¿Como eliminar las tablas que no le pertenezcan a una base de datos en un TreeView? c# Windows Forms, Microsoft SQL Server

Resulta que tengo un TreeView que me muestra todas las bases de datos que hay con sus respectivas tablas. El problema como verán es que me aparecen tablas a las que le pertenecen a una base de datos pero que tambien les aparecen en otras, lo cual está mal.

introducir la descripción de la imagen aquí

Y lo que quiero es que me muestren nomas las tablas a las que les pertenecen la base de datos únicamente.

       TreeNode node;     TreeNode hijo;     private void Form1_Load(object sender, EventArgs e)     {         DataTable tabla = new DataTable();         DataTable tablas = new DataTable();          ReglasDeNegocios.OperacionesBD operaciones = new ReglasDeNegocios.OperacionesBD();         if (operaciones.BaseDatos(sUsuario, sPassword, ref tabla))         {               foreach (DataRow dr in tabla.Rows)             {                 node = new TreeNode(dr["name"].ToString());                 string hijos = Convert.ToString(dr["name"].ToString());                 if (operaciones.BaseDatos(sUsuario, sPassword, hijos, ref tablas))                 {                     foreach (DataRow dr2 in tablas.Rows)                     {                          hijo = new TreeNode(dr2["Tabla"].ToString());                         node.Nodes.Add(hijo);                     }                     treeView1.Nodes.Add(node);                 }              }             }         else         {              MessageBox.Show("Ocurrio un error: " + operaciones.sLastError);         }     } 

Asi mando a llamar la BaseDatos:

  public Boolean BaseDatos(String sUsuario, String sPassword, String BD, ref DataTable Tabla)     {         Boolean bAllOk = false;         using (SqlConnection conexion = new SqlConnection())         {             try             {                  conexion.ConnectionString = $  "Server=ROBERTODIAZ; User Id={sUsuario}; Password={sPassword}";                 conexion.Open();                 SqlCommand comando = new SqlCommand($  "use {BD} select sc.name+'.'+tb.name AS Tabla from sys.tables tb inner join sys.schemas sc on tb.schema_id = sc.schema_id order by Tabla ASC", conexion);                 SqlDataAdapter adapter = new SqlDataAdapter(comando);                 adapter.Fill(Tabla);                   bAllOk = true;              }             catch (Exception ex)             {                 sLastError = ex.Message;             }             finally             {                 conexion.Close();             }         }         return bAllOk;     } 

¿Como solucionarían esto?

SharePoint Online – How to make custom forms launch in a dialog?

I’ve created a new custom edit form for a document library in SharePoint designer. “Launch forms in a dialog?” option in advanced settings is set to “yes”, however, it does not affect anything. The form always shows as page. Out-of-box Edit form for a customized document type always pops up as a dialog, however, all other forms, including out-of-box forms for customized link to a document and document set, always appear as page. Please help. Is there a way to specify page appearance on the page definition?

SP13 with IP13 forms and no IP13

Are there workarounds for manipulating InfoPath forms now that IP13 has been deprecated? Caveats: I cannot use SPD (limited energy-user [for lack of a better term] SP deployment) and I now have a machine with MS Office 2016 (IP no longer offered as a stand-alone program). I have several IP forms that were created when I had a Office 2013 machine that need updating, etc. Is my only option to delete the IP forms and just use OOTB solutions? Thank you in advance for any help/info/answers.

Windows Forms decrypt password SQL Entity Framework

tengo la siguiente cuestión, necesito hacer un proyecto en windows forms que consulte datos de una base de SQL que fue generada por Entity Framework, entonces estoy tratando de comparar contraseñas entre la que ingreso por WF con la que tengo en la base de datos, la cuestion está en que EF encripta los datos de la contraseña y por tanto si lo tengo que comparar pues, necesito desencriptarlo. Esto es una suposición, no se haya otra forma de comparar estos datos. Y pues este es el código que tengo

public partial class MainWindow : Window {     private Models.SecurityController _security;     public MainWindow()     {         InitializeComponent();         _security = new Models.SecurityController();     }      private void Button_Click(object sender, RoutedEventArgs e)     {         var email = EmailInput.Text;         var pass = PassInput.Password;         email = email.Replace(" ", "");         if (email == "" )         {             EmailInput.Focus();             Errorlbl.Content = "Por favor utiliza un mail valido";         }         else if (pass == "")         {             PassInput.Focus();             Errorlbl.Content = "Por favor utiliza una contraseña";         }         else if (email != null && pass != null)         {             using (DBEnt db = new DBEnt())             {                 var item = db.AspNetUsers.Where(u => u.Email.Equals(email)).FirstOrDefault();                  if (item == null)                 {                     Errorlbl.Content = "Usuario mail invalido";                 }                 else {                     Errorlbl.Content = "Usuario valido";                 }                  var query =                 db.AspNetUsers.Where(u => u.Email.Equals(email)).FirstOrDefault();                 var hashedpassword = query.PasswordHash;                 var unhashed = _security.Decrypt(pass, hashedpassword);             }         }     } } 

hasta este punto hashedpassword me devuelve null

Y todo esta es la clase SecurityController

class SecurityController {     public string Encrypt(string key, string data)     {         string encData = null;         byte[][] keys = GetHashKeys(key);          try         {             encData = EncryptStringToBytes_Aes(data, keys[0], keys[1]);         }         catch (CryptographicException) { }         catch (ArgumentNullException) { }          return encData;     }      public string Decrypt(string key, string data)     {         string decData = null;         byte[][] keys = GetHashKeys(key);          try         {             decData = DecryptStringFromBytes_Aes(data, keys[0], keys[1]);         }         catch (CryptographicException) { }         catch (ArgumentNullException) { }          return decData;     }      private byte[][] GetHashKeys(string key)     {         byte[][] result = new byte[2][];         Encoding enc = Encoding.UTF8;          SHA256 sha2 = new SHA256CryptoServiceProvider();          byte[] rawKey = enc.GetBytes(key);         byte[] rawIV = enc.GetBytes(key);          byte[] hashKey = sha2.ComputeHash(rawKey);         byte[] hashIV = sha2.ComputeHash(rawIV);          Array.Resize(ref hashIV, 16);          result[0] = hashKey;         result[1] = hashIV;          return result;     }      //source: https://msdn.microsoft.com/de-de/library/system.security.cryptography.aes(v=vs.110).aspx     private static string EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)     {         if (plainText == null || plainText.Length <= 0)             throw new ArgumentNullException("plainText");         if (Key == null || Key.Length <= 0)             throw new ArgumentNullException("Key");         if (IV == null || IV.Length <= 0)             throw new ArgumentNullException("IV");          byte[] encrypted;          using (AesManaged aesAlg = new AesManaged())         {             aesAlg.Key = Key;             aesAlg.IV = IV;              ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);              using (MemoryStream msEncrypt = new MemoryStream())             {                 using (CryptoStream csEncrypt =                         new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))                 {                     using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))                     {                         swEncrypt.Write(plainText);                     }                     encrypted = msEncrypt.ToArray();                 }             }         }         return Convert.ToBase64String(encrypted);     }      //source: https://msdn.microsoft.com/de-de/library/system.security.cryptography.aes(v=vs.110).aspx     private static string DecryptStringFromBytes_Aes(string cipherTextString, byte[] Key, byte[] IV)     {         byte[] cipherText = Convert.FromBase64String(cipherTextString);          if (cipherText == null || cipherText.Length <= 0)             throw new ArgumentNullException("cipherText");         if (Key == null || Key.Length <= 0)             throw new ArgumentNullException("Key");         if (IV == null || IV.Length <= 0)             throw new ArgumentNullException("IV");          string plaintext = null;          using (Aes aesAlg = Aes.Create())         {             aesAlg.Key = Key;             aesAlg.IV = IV;              ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);              using (MemoryStream msDecrypt = new MemoryStream(cipherText))             {                 using (CryptoStream csDecrypt =                         new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))                 {                     using (StreamReader srDecrypt = new StreamReader(csDecrypt))                     {                         plaintext = srDecrypt.ReadToEnd();                     }                 }             }         }         return plaintext;     } }    

Quiza me estoy complicando mucho, alguien sabe como puedo hacer esto mejor o si lo estoy haciendo bien?

I will create and Customize wordpress Gravity Forms and Ninja Forms for $5

I will help you design responsive and advanced form in gravity form here are some advanced features which I can make in the form:- 1. Add image in the form 2. Set Conditional Logic for any field 3. Formatting of notifications to get beautiful form output in mail 4. Redirect, route or set any page link to open after submitting a form 5. 2 column / 3 column / 4 column or 5 column form layout for specific field. 6. Custom Thank You or confirmation page 7. Multiple email step for notifications 8. Add custom HTML Code. 9. Add input Mask and Placeholder 10. Captcha & anti Honeypot security setup So feel free to order my gig, I will give the best results with guaranteed satisfaction. 100% money back if you don’t satisfied with my work.

by: WordPress300
Created: —
Category: WordPress
Viewed: 260


develop 1 to 5 fillable PDF forms for 10usd for $10

Hello, I can prepare 1-5 fillable PDF Forms/Documents within 5 hours for only $ 10. I am here to change anything in your PDF & IMAGE documents. I offer for urgent editing on such documents. I am here to work for you. I will modify any type of your document to an editable format. WHAT YOU WILL GET from my side: Fillable PDF FormUnlimited Revisions.Fast Delivery.100% SatisfactionIf you need more than 5 pages PDF Fillable Form design then please contact me I will provide a special offer for your requirements. Thanks Jagadish

by: jneupane
Created: —
Category: Virtual Assistant
Viewed: 231


Existing content type add new/edit/display forms

I have a Content type that is being used on a list on many subsites.

I’d like to replace add/new/edit forms for that content type.

It is on Office 365 + i cant use sandbox code at all. Only option is to use Client Object model through silverlight or javascript’s JSOM. I’ve seen an example here that deploys new/edit/display forms path to ‘_layout’ folder. Can i update existing Content Type to point to new forms on Office 365 that reside maybe on a sites root etc?

Forms Authentication in Sharepoint 2013, _vti_bin/authentication.asmx error

I’m getting this error when using CSOM in a FBA web application that is configured agains’t a custom FBA provider. I’m getting this error when site is configured for Forms, if a disable forms with windows auth I can get web url. Probably would be a configuration error if anyone can helpme…

I’m getting the error when Forms is configured:

Server was unable to process request. —> Could not retrieve the IIS Settings. Parameter name: context

Here is my CSOM code:

using (ClientContext context = new ClientContext("http://10.34.116.35:41443")) context.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication; context.FormsAuthenticationLoginInfo = new FormsAuthenticationLoginInfo("carles", "test"); Web web = context.Web; context.Load(web); MessageBox.Show(web.Url); context.Dispose(); 

Thanks

Powerapps or spfx to built forms in SharePoint online?

I need to create a few forms on SharePoint online, but first I would like to know which one to use PowerApps or SPFx?

Can I use workflow on powerapps or spfx?

Edit: the complexity of the form is like this: These forms are not bound to a particular list or library. The form will contain different tabs, thus different views. Depending on the status of the workflow, a different view (tab) will be enabled.

Later some graphs can be added.

thank you.

Is there any evidence for or against consent forms in game? [on hold]

The new hype this year seems to be consent forms for RPG Sessions. I’m all in on having a safe game, and keeping an eye open for players feeling bad during a game. Therefore, even my Kult sessions are tame because I don’t think that exploitation is a valid way to generate tension. But other people might have different experiences.

In my layman’s view, the consent forms seems to be at least not effective or at most being damaging. If someone is comfortable enough to make their triggers known in an impersonal form, a summary of the possible topics plus a conversation with each player prior to a particularly heavy setting should suffice for the GM that have some grasp of their players (this does not remove the responsibility of keeping and eye open DURING and AFTER the game for any inconveniences or problems).

And if someone ISN’T comfortable filling a form (peer pressure, unresolved traumas, lack of knowledge of what might trigger they, etc), then a session might end up abusing its theme because no one ticked that particular box in the form and the tension that the GM sees in the table they could assume is due to the setting and not something that is triggering a player.

I tried to find something to support or rebuke those ideas, but had no luck. So, if someone has any pointers in that direction, or has some formal training/experience in psychology and trauma, please, chime in.