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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Coding is not working for Making Password Field Encrypted in sql and using sessions .basically its a

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
Dim cn As SqlConnection         Dim cmd As SqlCommand         Dim dr As SqlDataReader         cn = New SqlConnection         cn.ConnectionString = ConfigurationManager.ConnectionStrings("fees_systemConnectionString").ToString         cn.Open()         cmd.Connection = cn         cmd.CommandType = CommandType.Text         Dim Hashpass As String = FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text, "sha1")         cmd.CommandText = "Select * from login where username='" & Me.txtUsername.Text & "' and password = '" & Hashpass & "'"         Dim re As SqlDataReader = cmd.ExecuteReader()         If re.HasRows Then             While re.Read()                 Session("email_id") = re("username").ToString()                 Session("MemberType") = re("type").ToString()                 Session("ISLOGIN&

View Complete Post

More Related Resource Links

Do Post to Iframe in same page, and Password Field


Hi all,

I need do post of a form in my page to Iframe in the same page.

I set target in form tag.

<body onload="document.formuno.submit()">

                               <form name="formuno" method="post" action="http:\\externalCompany.WebForm.aspx" target="framename"  >

                                               <input type="hidden" name="prueba"  value="pruebatxt" runat="server">

<input type="hidden" name="prueba2"  value="pruebatxt" runat="server">

<input type="hidden" name="prueba3"  value="pruebatxt" runat="server">

<input type="hidden" name="password"  value="MY PASSWORD" runat="server">


Working with CodePlex. How to save password for project?


I want to make public one small project on CodePlex. Everybody knows that you can work with CodePlex like with TFS client and with SVN client as well. But really I can't work with it from SVN client. When I tried to add some binary file (it was dll) I got the error "Server sent unexpected return value (200 OK) in response to PUT request for .". How to solve this problem I don't know, I found thread at CodePlex's discussions Can't commit binary files using TortoiseSVN, but last message was at past year. Ok, I'm working with TFS at work, so for me it will be not a problem connect to CodePlex with TFS. But there are some distressing case, Visual Studio always ask credentials at every new connection to project. And I didn't find a checkbox "Save credentials". But I found the method. Read more...

Team Discussion Modified by field not working

Hello, I have a team discussion board set up which uses a threaded format. However, my issue is with the Modified by field. I believed this would show me the last user that had replied to a discussion but the field continues to display my user name since I was the creator of the discussions in the first place. Am I using the wrong field? Something tells me that the columns I have to choose from are all in regards to to discussions and not to the message replies themselves. In the end, I'm looking for something very similar to your forums here. Discussions should be displayed with title, created by, timestamp, last user who replied and timestamp.Beth Singley PBM Graphics

Encrypted and Decrypted Field.

Hiii All; Hope you are doing well .. I want to encrypt all the data under one of the column we got here. How can i do that?! And what shall i do to decrypt it? The current data is something like this: Name:           Number: Smith            123456 Gorge           938483 So I want it to be like this: Name:            Number: Smith             XXXXXX Gorge            XXXXXX   Thank you.

Change password for FBA users in claims setup not working as expected

Hi, I am trying to add a standard asp:changepassword control for external users. In the previous 2007 sharepoint environment this control was working "out of the box". I am pretty sure what is wrong as well,- but not sure how to fix it. A workaround that makes me able to change password is as follows: in the asp - control, I have added the option DisplayUserName="true" Then in the actual web-page, i can see that my username is: 0#.f|acaspnetsqlmembershipprovider|xxxxxx and not xxxxxx as i would excpect, as i use xxxxxx to log in. Editing the username to just xxxxxx makes the changing of password work, but this solution is not really nice to deploy to the normal end-users.. Any suggestion on how to make the username right? I've tried to set the username using the option UserName="<%=SPContext.Current.Web.CurrentUser.LoginName%>", but it does not seem to evaluate..  

Binding list to form not working with '&' character in list field data

Hi, I have a SharePoint list with a field called Title. I have a form based on this list with the field bound to the form as a label (for workflow to access). Here is the code for the form field. <asp:Label runat="server" id="ff2{$Pos}" text="{@Title}" __designer:bind="{ddwrt:DataBind('u',concat('ff2',$Pos),'Text','','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}" /> I have a workflow that runs through a form action button which take ff2 (title) and  does other stuff. The problem I have is with records where the value of 'title' contains the '&' character (example ab&cd). Blank is pulled in by the workflow when I get the value of ff2. I am guessing it has to do with the data binding and/or escape (special) characters coming through but I don't know how to fix it. Any help will be greatly appreciated

i have tested the same coding with dropDownlist but its working fine..I don't know why its not work

Dear Members,              I have used the following to bind the data from database into Ajax comboBox...but it's not working...             Actually i have tested the same coding with dropDownlist but its working fine..I don't know why its not working with Ajax ComboBox..          DropDownList Coding  private void LoadDropDownCatetory() { string connectionString = ConfigurationManager.AppSettings.Get("mcrmdb"); dropDownListTest.DataSource = ProductDataAccess.FillProductCategory(connectionString); dropDownListTest.DataTextField = "CATEGORY"; dropDownListTest.DataValueField = "CATEGORY"; dropDownListTest.DataBind(); } AjaxComboBox Codingprivate void LoadProdutCategory() { string connectionString = ConfigurationManager.AppSettings.Get("mcrmdb"); comboBoxProductCategory.DataSource = ProductDataAccess.FillProductCategory(connectionString); comboBoxProductCategory.DataTextField = "CATEGORY"; comboBoxProductCategory.DataValueField = "CATEGORY"; comboBoxProductCategory.DataBind(); } Design

Making sure AJAX is working.

Is there a way to make 100% sure that the postback happening is a partial post back and not a full one? I have a few pages done up using AJAX but I am not sure if they are doing partial or full post backs. I tried using "IsAsync"  but nothing is being triggered under it. I am using C# and .Net 4.

How does Twitter maintain password field on postback?


I know that for security reasons, it's generally frowned upon to try and maintain a password field on a postback, but I'd still like to figure out a way to have it done. For example, Twitter. If you try to start a new account, and let's say the username you've chosen has already been taken, the page posts back with an error. But, with Twitter, the password field does not clear. How are they doing this?

I find it annoying in a situation like this, because if the username is already taken, that means you have to go back and fill in the password field too.

How does Twitter do this?...

ReadOnlyEnforced not working? How to make a field always read only?



I want to create a custom content type (a feature) and includes a field that will be always displayed to user but always in ReadOnly mode.

I'm creating items from a worklfow and what to unable user to modify some values....

I'd make some reasearch and found the "ReadOnlyEnforced " attribute.



This is the attribute definition: Optional Boolean . TRUE to specify that the user cannot change the field by any means and that it can only be changed by the system.


This is what I do and redo again to be sure... but it's not working! I'm starting to be a little bit discourage about that, because I can't allow user to change value of this fields...

It's a little bit frustrating, because the definition gave in documentation is right what I need lol But it's not working...

Anyone had this kind of problem? Any solution?






Onchange event for datetime field in javascript is not working?


I want to compare start date and end date when start date is changed. If start date is big, on change event i need to make the end date the same as start date.

So I wrote On change event for start date. But it doesnot work  

getField('input','Start Time').onchange = function() {showEndDate()};


function showEndDate()



var date1 = getField('input','Start Time');

var date2 = getField('input','End Time');


but its not firing at all. So you guys have any idea or any other way to do for datetime on change event?

Calculated field Sorting Now Working , but have performance question


 Thanks to mitja.GTI.

My sorting is working ...

although i had to take the table that has my calculated column and make a view (so i could filter) and then bind the gridview to the view.

My question is as this.

1.) in order to get my calculated field i had to load my data into a table (as suggested)

2.)Add a column to the table and perform calculations

3.)make a dataview from the tables because i could not get the Gridview.datasource= ds.tables("loads").select("Deadhead <= " & sngRadius

4.)the largest of the 3 tables my query is based on contains about 7000 records. The way i have the logic & programming now everytime a new "truck location" is put in the textbox1 and "find loads/button1" is clicked. It calculates the deadhead miles of all 7000 records before filtering. I am filtering based on the deadhead miles.

Does anyone have any recomendation about how to speed this up a bit.

Also in order to get paging to work i had to rebind/filter the data again ... means looping through all 7000 records each time paging is called. This seems terribly ineffecient as i am already forced to use access instead of SQL.


Password Encrypted Email in C#


Hi all ,

I need to send password encrypted email in C# -

how hard is this to do ?,

and how to do it ...??

Do you nee SSL certificate or not ?

I know how to send normal emails becuase i did it already but not encrypted emails

If you have personal experience , then tell me the how.

Thx guys . Your help is appretiated

User Profile working, but domain in the Account Name field is incorrect


Profile import is working with a small set of users from just one OU. The synchronization connection has a Forest Name of "corp.mycompany.com", just like in our current profile settings in MOSS 07.

However, the user profiles created are listed with "corp" as the domain, not "mycompany".

E.g. my profile Account Name shows "corp\eriehl", but it should be "mycompany\eriehl".

How do I update this reserved property to contain the correct value for our domain?

Binding password to password field


I have a form that is used to add and edit data. Based on a dropdown selection, the form is either prepopulated or left blank so you can add new data.

I have a password field that is set to TextMode="Password" and works fine when adding new data, it displays ***** as you type..

Now if you select from the dropdown and there is already a record on file, it populates the form to allow you to edit the information.. Now i DONT want to display the password in plain text, but i want to populate the field so if they make any changes all field data is kept and table is updated with all of it.


I already debugged the page and my variable is being set with the password, but the textbox doesnt even show the ***** for the password value.

Report Builder returning #Error value in empty fields and working with Date field


Hey guys,

I am trying to build a report using the date field from CRM and only wanting to return the date I am using this expression "=Fields!new_date.Value.ToShortDateString()" but when there is an empty fiel I get #Error. How do I solve this?

Also is there anyway to return the date field with the actual month showing instead of the numerical value? i.e. instead of 1/31/2010 Have it show January 31, 2010 (Doesn't have to be exactly in that format, but want the name value for the month.)

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