|
Thanks Christian,
I'll look into that, one more question...
Does ths even apply when i'm not doing the original databinding manually, i'm just letting the datasource/datagrid sort it out them selves. Calling the DataBind() proc just seemed like a sensible thing to try to force it to update.
|
|
|
|
|
Christian, thanks.... that worked excellently. 
|
|
|
|
|
sir,
Just to encrypt a string, i used this code.
code:
public string encryptText(string plaintext,string passpharse,string saltValue,string hashAlgorithm,int passwordIterations,string initvector,int keysize)
{
byte[] InitVectorBytes = Encoding.ASCII.GetBytes(initvector);
byte[] saltValueBytes = Encoding.ASCII.GetBytes(saltValue);
byte[] plaintextbytes = Encoding.ASCII.GetBytes(plaintext);
PasswordDeriveBytes password = new PasswordDeriveBytes(passpharse, saltValueBytes, hashAlgorithm, passwordIterations);
byte[] keyBytes = password.GetBytes(keysize / 8);
RijndaelManaged symmetricKey = new RijndaelManaged();
symmetricKey.Mode = CipherMode.CBC;
ICryptoTransform encryptor = symmetricKey.CreateEncryptor(keyBytes, InitVectorBytes);
MemoryStream memorystream = new MemoryStream();
CryptoStream cryptostream = new CryptoStream(memorystream, encryptor, CryptoStreamMode.Write);
cryptostream.Write(plaintextbytes, 0, plaintextbytes.Length);
cryptostream.FlushFinalBlock();
byte[] ciphertextbytes = memorystream.ToArray();
memorystream.Close();
cryptostream.Close();
string ciphertext = Convert.FromBase64String(ciphertextbytes);
return ciphertext;
}
I've got the following errors:
Error 1 The best overloaded method match for 'System.Convert.FromBase64String(string)' has some invalid arguments.54,29
Error 2 Argument '1': cannot convert from 'byte[]' to 'string'.54,54
Please help me to resolve it.
|
|
|
|
|
You've declared ciperTextBytes as a byte array, when it needs to be a string.
ConvertFromBase64String(string) is telling you that you need to pass the parameter to it as a string data type.
I'm not 100% sure with out testing it, but
string ciphertext = Convert.FromBase64String(ciphertextbytes.ToString()); !!MIGHT!! work.
Cheers
Shawty
|
|
|
|
|
|
You need to describe it better than that i'm afraid.
the .ToString()??? the function??? the routine??? try to convert your byte array to a string before hand. It's fairly easy.
All you need to do is iterate through the array collection and convert each byte to a char before adding it to a string.
Cheers
Shawty
|
|
|
|
|
Sir,
please explain it in detail
|
|
|
|
|
There's not much to it.
You just need to declare a string, make it empty :
String [myvariablename] = ""
then you just need to loop over your byte array :
foreach(byte [mybytevariablename] in [mybytearrayname])
then in the loop just concatenate each element.
[myvariablename] = [myvariablename] + [mybytevariablename]
When your finished, then the string you defind should be a string of all the chars in your byte array which you can then pass to the function.
replace the [..] above as appropriate for your variable names where you've defined them.
|
|
|
|
|
If you can write encryption code, I fail to understand why you have a problem with such trivial error. At least you tell me what your code is trying to do, and why you are impementing it this way.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Hi,
Good Day!!!
I did a asp.net website application in one system. When I place the same application in other system, I could not able to open it.
Can anyone please suggest me that what are the minimum requirements to be done to open the application in other system?
Thanks,
Ravi Chandra.
|
|
|
|
|
nuthan anand wrote: I did a asp.net website application in one system. When I place the same application in other system, I could not able to open it.
What does it mean? VS is there ? Did you copied complete Web sites and Solution file?
nuthan anand wrote: Can anyone please suggest me that what are the minimum requirements to be done to open the application in other system?
Open VS -> File -> Open -> Web sites.
Browse the folder , and open it.
That's all.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I think the most common thing is this. Someone creates a website within visual studio and so the security on the directory is handled for you. Then you move the directory to someother location for deployment and it doesn't work. Typically this is because the service that is running doesn't have proper access to the new directory. However, it would be more helpful if you shut of friendly error messages and posted what the exact error is that your getting.
|
|
|
|
|
HI all,
I gave the stored procedure for a sql adapter(database1) and in the select command i selecedt stored procedure ..
I have other adapter(database2) in tat i gave the update stored procedure for same table.
can i do the code like this
sqladapter1.fill(ds)
take that dataset and update to other sqladapter 2
sqladpater2.update(ds)
wether it will work?
or any other idea or easy way to insert a table datas from one db to other db table ..
pls help me
|
|
|
|
|
try googling:
1.) T-SQL Append from
2) .NET SQlCommand
should answer all your questions in the 1st page of each search
|
|
|
|
|
Specifically:
Windows Server 2008 Datacenter 64-bit
Oracle 10.2 instant client x86 64-bit
IIS 7
.NET 3.5 / ASP application
The behavior is that the app pool sometimes crashes when I hit the website, or sometimes it gives a database connection ASP error page. I can get it working by stopping the site, then renaming the directory and binding the site to the renamed directory. I startup the site and it works! But when I reboot the machine it doesn’t work, so it seems like there’s something intermittent with the database drivers.
Any suggestions?
|
|
|
|
|
Khaldris wrote: he behavior is that the app pool sometimes crashes when I hit the website
How did you say that? Is there other application also added to the same application pool ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I'm not at the deployment site at the moment, or I would be able to tell you. I'm currently installing IIS to my machine locally in order to test it here.
|
|
|
|
|
|
Hi Guys...
I am using "CalendarExtender" on a TextBox in ASP.NET...
when run the WebSIte...this "CalendarExtender" is hidden by other controls of web pages..
So I can see only few parts of this "CalendarExtender" control...
<cc1:CalendarExtender ID="txtDate_CalendarExtender" runat="server"
Animated="true" EnabledOnClient="true"
Enabled="True" TargetControlID="txtDate" PopupPosition="Right">
</cc1:CalendarExtender>
Please Help me out...
Thanks
|
|
|
|
|
Just place Extender and any server control in same DIV
|
|
|
|
|
Could you please provide me sample code?
|
|
|
|
|
you didn't post any code to comment on.
suspect
<blockquote class="FQ"><div class="FQA">Sr...Frank wrote:</div><cc1:CalendarExtender ID="txtDate_CalendarExtender" runat="server"
Animated="true" EnabledOnClient="true"
Enabled="True" TargetControlID="txtDate" PopupPosition="Right">
</cc1:CalendarExtender></blockquote>
<div>
TextBox declare here Id must = txtDate
<cc1:CalendarExtender ID="txtDate_CalendarExtender" runat="server"
Animated="true" EnabledOnClient="true"
Enabled="True" TargetControlID="txtDate" PopupPosition="Right">
</cc1:CalendarExtender>
</div>
OT :preview stoped working
modified on Thursday, March 12, 2009 4:24 PM
|
|
|
|
|
|
Bibhash Mishra wrote: i have already googling to find the source but not able to find any suitable RSS
why do you need RSS for this? you can do it your self. start with your location (where your server is located) and then calculate the time difference for every city you want to show.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Yes, i would agree with that.
In fact this is a perfect thing to use the new dynamic list & linq features for.
Somthing like :
public class timeEntry
{
Public String name = "";
Public DateTime time = DateTime.now();
}
then make a list of timeEntrys
List<timeentry> myList = new List<timeentry>()
{
new timeEntry(){ name = "London", time = DateTime.Parse("1/1/1 00:00:00") },
new timeEntry(){ name = "Paris", time = DateTime.Parse("1/1/1 01:00:00") },
... and so on ...
};
You can then assign it to a datagrid or anything else in code by using the following :
var timeList = from p in myList
select p;
gridView1.DataSOurce = timeList;
gridView1.DataBind();
As your making the list by hand, you can apply what ever maths you want to apply in the relevent areas of the constructor.
|
|
|
|