.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

How to Encrypt and Decrypt a Password using SQLSERVER 2005?(Video)

Posted By: syed shakeer hussain     Posted Date: March 14, 2010    Points: 2   Category :Sql Server
Encypt and Decrypt a Password using SQLSERVER 2005(Video)

View Complete Post

More Related Resource Links

Problem with decrypt password


hello everyone:



I encryped password to the binary variable in sql server with this code:

 DataClasses1DataContext db = new DataClasses1DataContext();
            var info = new passdefine();
            info.username = TextBox1.Text;
            string strcry = TextBox2.Text;
            byte[] bt = new byte[strcry.Length];
            bt = System.Text.Encoding.UTF8.GetBytes(strcry);
            RSACryptoServiceProvider RSA1 =new RSACryptoServiceProvider();

            bt = RSA1.Encrypt(bt,false);

            info.password = bt;


And it worked properly but when Want to decrypt it , I get this error:BAD DATA.  

And I use this code:

DataClasses1DataContext db=new DataClasses1DataContext();
            var info = from m in db.passdefines where m.username == TextBox1.Text select m;
            foreach (var item in info)

                byte[] bt = new byte[item.password.length];
                RSACryptoServiceProvider RSA1 = new RSACryptoServiceProvider();
                bt = RSA1.Decrypt(item.password.ToArray(), false);
                string pass = System.Text.Encoding.UTF8.GetString(bt);

SQLServer 2008 Tools and SQL 2005 Cluster

I recently built a SQL Server 2005 cluster on the o/s Windows Server 2008 R2.  I have been attempting to connect to the cluster from my Windows 7 dekstop with my SQL Server 2008 Tool set.  I have been unable to attach to this cluster since its creation. The firewall is temp off, remote connections in the surface area configuration is set to pipes and tcp/ip and the Browser surface is up and running. I ran Wireshark against the cluster and I could see that there was UDP conversations for ms-sql-m (SQL Port) but that was as far as it would get.  I am using a named instance so not using 1433, but I do see the cluster offering up high RPC ports but the client never responds after the initial UDP response. When I noticed that there was a two way conversation taking place, I went to a seperate machine and fired up SQL Server 2005 Tools and I was easily able to attach to the cluster.  So my question is - Are there any known incompatibilities between SQL Server 2005 cluster services and SQL Server 2008 Tool set?  I can use my 2008 tools to attach to a non-clustered SQL Server 2005 w/o issue.   Error when attempting to connect: A network-related or instance-specific error occured while establishing a connection to sql server.  The server was not found or was not accessible.  Verify that the instance name is correct and the SQL Server is con

Windows Mobile 5 , SQLSERVER/EXPRESS VB.Net 2005 Datareader NullException

Hi all, Recently I have started learning developing Smart Device Applications using .Net.Am using WM 5.0 SQLServer 2005 Express and VS 2005 (VB). In my application, I made a form with some comboboxes and other fields.In the form load am calling a function in my classfile.This function intends to fill the combobox.Please refer the codes below. 1 . The Form Load event in the Form Imports ShoppingList.DB Public Class frmMain Dim objDB As New DB Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load objDB.FillComboBox(cmbCat, "SELECT * FROM TABLE ORDER BY ID_PK") End Sub End Class 2 .Now the DB cls file Imports System Imports System.Data Imports System.Data.SqlClient Public Class DB Dim strCon As String = "Data Source=,1010;Initial Catalog=DB_Shopping;User ID=***;Password=****" Public Sub FillComboBox(ByVal cmbTarget As ComboBox, ByVal Sql_SP As String) Dim dbConn As New SqlConnection(strCon) Dim sqlCMD As New SqlCommand(Sql_SP, dbConn) Try dbConn.Open() Dim dr As SqlClient.SqlDataReader dr = sqlCMD.ExecuteReader() 'dr = sqlCMD.ExecuteReader(CommandBehavior.SequentialAccess) While dr.Read() cmbTarget.Items.Add(dr(0)) End While

PAGEIOLATCH_SH causing long delays after upgrade to SQLSERVER 2005

Some processes in our PeopeSoft system are running extremely long after upgrading from SQLSERVER 2000 to SQLSERVER 2005 SP4. Processes that use to run in 15 minutes now take 4 hours to run. Some processes run in the same amount of time and don't seem to be affected by the upgrade. When I examine the long running processes in Activity Monitor I see the wait type showing up as PAGEIOLATCH_SH. Any ideas as to what might be going on? Our SQLSERVER implementation is a standard install. What should we be looking at to improve the situation?

SSIS Package Protection Level Errors - decrypt protected XML node "DTS:Password" with error 0x800900

Error 7 Error loading GetData.dtsx: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.   c:\Packages\GetData.dtsx 1 1  Error 8 Validation error. Data Flow Task: OLEDB Source [5310]: The AcquireConnection method call to the connection manager "SourceServer" failed with error code 0xC0202009. GetData.dtsx 0 0 Environment I need to execute - BIDSHave Solution, with files linked with VSS. When I click on package, aforesaid errors show up and package opens in designed.Protection Level : Encrypt Sesitive with User KeyThis means it'd run only on machine and by user where and who created respectively.So I changed it to Encrypt Sesitive with Passoword and provided Passoword. No luckSo I changed it to Do not save sensitive, as anyways in the connection manager, it has Expression saying @Variablename (with appropriate correct syntax), and variable is mapped to config file. I tired with Config file and also by hardcoding the value in the connection manager's connection string after removing the variable name, also tried by hardcoding value in variable value and disabling config file.Nothing works. I read 3 threads discussing this issue by othe

Failed to decrypt protected XML node "DTS:Password" with DontSaveSensitve Checked



I have been researching and researching this.  First, I have all my packages all have the protection level set to DontSaveSensitive.  Second, all my passwords are stored in a config file.  This config file location is stored in an env variable.  The packages are all calling the config files from package configurations.

If I do the development on our dev server I dont' have a problem. As soon as I go to our test box, I get the error or if another person accesses it and tries to run it they get the error.

I have no idea to fix this.  The only solution I have found anywhere is to change the protectionlevel.  Changing it to rely on server gives me more error messages.  I honestly don't remember having this issue before now.

please help!



Invalid column name sqlserver 2005, asp.net, vb.net

Hello Friends.
  I am getting an error while tryng to write to sql server. I can't figure out whats wrong. I tried over and over and through some of you may be able to see through the erro instantly. 
the error says "Invvalid "ClientID"" whcih is not true. I double checked the typos and the type. I declared it as varchar(250) and its not declared as identity field,w hich I knew I should but I didnt' in this case
Little background on the set up
I have a table named jobs where I have a jobID as the pk(autogenerated colum) and clientID which his not foreign or any kind of key, yet anyway. and rest of hte field as you see below in my code. Why am I getting this error? Any clue?
I really appreciate if you could help me.
My relevant code
If Page.IsValid Then
            Dim jobdsn As New SqlDataSource
            jobdsn.ConnectionString = ConfigurationManager.ConnectionStrings("CandidatesConnectionString").ToString()
            jobdsn.InsertCommandType = SqlDataSourceCommandType.Text
            jobdsn.InsertCommand = "INSE

Decrypt the encrypted store procedure through the T-SQL programming in SQL Server 2005


HI ,


I have a encrypted store procedure in my production server .Right now I do not have the script now I want do some modification.

Please any one can help me to decrypt the store procedure it will be a great help for me.


For any suggestion thanks  in advance.

" Education is the beginning of transformation. Dedicate yourself to daily learning via Blogs/Forums/books and coaching "
Click here to read my blog

Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B



I have developed several SSIS packages with the last Beta of VS2005 / SQL Server CTP. After the public release I tried to uninstall the CTP-Versions to install the msdn finals but this time I got lost and was not able to satisfy the requirements of the final setup of VS2005. So I decided to install the whole pc again and after some hours I had a clean machine (XP with latest SQL Server 2005 Standard and VS2005 Professional).


Now I have tried to open my SSIS-Project but getting the following error:


Permissions needed to run DTS packages in SQLServer 2005



I was asked to document the permissions to enumarate, modify and execute DTS packages which we have on our SQLServer 2005 production server(s).

I know that the user needs read-access to sysdtspackage to list the DTS package(s), the user also needs to be the Owner of the package or sysadmin inorder to modify the package.

Now, there are three ways of running a DTS package stored in the msdb

[1] Run the package from the DTS designer

[2] Run from the command line via DTSRun

[3] As a DTS Task in SSIS

I have a DTS package (ExtractWestCoast.dts) which I wanted to test for permissions. So, I created a login named DTSTest and gave it db_datareader role to the msdb database (Note that I also have a Windows Authentication based login - CorpDomain\grajee - into the sqlserver with sysadmin role). With this role given, I logged into SSMS using DTSTest and made sure I was able to see the list of DTSPackages. I did a sample run of ExtractWestCoast DTSpackage expecting it to fail. But to my surprise the DTS package executed successfully. Using my regular id (CorpDomain\grajee), I enabled the logging feature on the DTS package so that it creates entries in the sysdtslog msdb system table for every run to see under whom the package runs. Using the DTSTest login, I executed the DTS package and it executed successfully. I checked the

Unable to install Sqlserver 2005 SP2 on a Virtual Server - Unable to install windows install MSI fil


Okay this is making me crazy...I am on a virtual server and this will not install...anyone have the solution.



conversion from 4D (4th Dimension database) to sqlserver 2005?


Hi There,

 I am just wondering if any one can help give some ideas how to migrate from 4D Database to Sqlserver2005? if you are wondering what 4D is? its a ralational database but I very interested and keen to migrate the whole database ? any ideas on this would be much appriciated




Attach .mdf file in sqlserver 2005 ( why Read-Only mode)



i am new to Sqlserver2005, when i attach .mdf file it takes Read-only mode, how to change it into writeable?

pls help me any one... and advance thanks

How to Decrypt value in SQL Server 2005


Hi...i have read some related posts , but i almost know nothing about SQL so i can't understand what i have to do. 

I'm doing a very very important assignment (i graduate university with this one) and i need to find a password so i can log in a script (which is connecting to sql server)

In SQL server i can see all the usernames , but the passwords are encrypted. Could anyone of you decrypt one of them so i can log in? I repeat it's nothing illegal or dangerous, it's 100% for my assignment and i need to do it this week or ... i won't graduate.

The password is encrypted as 098F6BCD4621D373CADE4E832627B4F6 . Please help me...


Sorry for my poor english, i'm from Greece so it's not my first language... Thank you!

problem with windows authenticatoin while installing iis features for sqlserver 2005

while i was enabling iis and its related component for sql server 2005 on windows7 . i did not get windows authentication in security. please hepl me to get this.

Sync local db access 2007 to webservice having sqlserver 2005



   From last few days i am struggling to auto sync from windows application developed in c# having connection with MS ACCESS 2007(.accdb) database, and having sqlserver 2005 in webservice.

 The problem is i cannot syncronize the access 2007 to sqlserver 2005, if any one have any idea about this plz help me out.


A strange question about maintenance plan in sqlserver 2005


This is SQLServer 2005EE.

I created one maintenance plan some time ago.

But today i found i can't execute it and drop it.

the error message is:"exception has been thorwn by the target of an invocation.(mscorlib)"

The strange thing is,now i can create a new MP and drop it.

I have not found any valuable clues on the web sites.

could you please help me?


If you haven't all the things you want,be grateful for the things you don't have that you didn't want.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend