|
|
hey thanks for the link..
scarface
|
|
|
|
|
Hi,
I want to insert information's of 10 customers, so i have created a collection<customer> and added 10 customer in it.
But to insert this 10 objects i have to loop and insert 1 by 1, which i don't want
I know with ado.net i can bulk insert using dataset and DataAdapter.
But here the case is different .
How can i bulk insert without using dataset and dataAdapter, the collections of objects.
Regards
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Hi,
The one way is you can use StringBuilder class and concat all the 10 object query. SQl simple excute all the 10 query very fast.
Regards
Anil Pal
|
|
|
|
|
but will it be sql injection proof.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
|
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "insert Tbemployee(TE_VC50_EmpName,TE_VC50_EmpImg,TE_VC50_EmpDesignation,TE_NU_EmpDepId)values(@empname,@empimg,@empdes,@empdepid)";
cmd.Connection = con;
cmd.Parameters.Add("@empname", SqlDbType.VarChar,50).Value = txtname.Text;
cmd.Parameters.Add("@empimg", SqlDbType.VarChar, 50).Value = fu_img.FileName;
cmd.Parameters.Add("@empdes", SqlDbType.VarChar, 50).Value = txtdes.Text;
cmd.Parameters.Add("@empdepid", SqlDbType.Int).Value = DDLTeam.SelectedValue;
fu_img.SaveAs("D:\\ION Projects\\IonIntranet\\IonIntranet\\Images\\EmpOM\\" + fu_img.FileName);
cmd.ExecuteNonQuery();
txtname.Text = "";
txtdes.Text = "";
cmd.Dispose();
every time file upload control return null value..any advice.
|
|
|
|
|
Hi,
Hmmmm.... The path should not be hard coded.
fu_img.SaveAs("D:\\ION Projects\\IonIntranet\\IonIntranet\\Images\\EmpOM\\" + fu_img.FileName);
Please use virtual path(Server.mapPath) and the folder should be inside the application folder.
Regards
Anil Pal
|
|
|
|
|
its working when i remove update panal.. but with update panal its not working.. can we apply more than one script manager on page or more tan one update panal in one page with one script manager
|
|
|
|
|
|
you cannot apply more that one script manager but u can use more then one update panel.
set mode conditional of update panel.
Regards,
Keyur Satyadev
|
|
|
|
|
thnx fren its working now..
|
|
|
|
|
hi,
I have created a tab using menu control and multiview.I want send a value when browsing from one tab to another.The value is to sent while visiting form one tab to another.HOw can I do this?
regards
bill
|
|
|
|
|
Please give more details.
Regards
Anil Pal
|
|
|
|
|
I am developing website in Asp.net 2.0 and planning to implement Ajax.
Can any one please suggest me which is best to use either
Jquery (or) Ajax control Toolkit..
I appreciate if you could give the reply soon...
Ramkumar(senior pgmr)
|
|
|
|
|
The control toolkit is excellent for morons. It basically does all hte work for you, so long as you want what it does. JQuery is an excellent library, but it doesn't give you the sort of prebuilt controls that ASP.NET AJAX does.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Use ajax toolkit. Its very easy to use with VS.net.
Cheers!
Regards
Anil Pal
|
|
|
|
|
thanks a lot...shall i start my project with Ajax tool kit itself?
Ramkumar(senior pgmr)
|
|
|
|
|
Yes , you can procced with it.
Regards
Anil Pal
|
|
|
|
|
I have to add the facilities of adding water mark on video files.
I am developing my application in c#.
any body help me for the same.
Thanks In advance.
|
|
|
|
|
Don't cross post. ASP.NET can't watermark a video, so asking in the C# forum, as you have done, is the right thing to do.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Dear Experts,
Do you have any idea encrypted string in Java and decrypt in asp.net using the same AES algorithm?
|
|
|
|
|
Sure - if it's the same algorithm, that should work just fine.
Help me is a stupid subject line. Everyone here wants help.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am trying to decrypt the string in asp.net which is encryted in java.I am able to do it till some extent but its not completely decrypting.
Here i am putting the code of both (Decryption through ASP.NET and Encryption through Java)
private String Encrypt() /// Done in Java return encryted string
{
String hexString="";
String msg="Sample Input Text";
SecretKeySpec skeySpec ="GbxDwxcjvjtpi0+lQuyfHg=="; // Autogennerate Key
try
{
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
byte[] encrypted = cipher.doFinal(msg.getBytes());
hexString=asHex(encrypted);
}
catch(Exception e)
{
System.out.println("Error in Encrypt"+e);
}
return hexString;
}
private void DecryptFunction() // Done in Asp.net
{
try
{
string strEncrypt = "fc8caff8581f9a3920b788490c3569ffb345e54c7f72a73ddb76256ff81fbfd6";// Encrypt string
string AutoKey= "GbxDwxcjvjtpi0+lQuyfHg==";
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = Encoding.UTF8.GetBytes(AutoKey= );
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;
ICryptoTransform crypt = tdes.CreateDecryptor();
byte[] cipher = FromHex(strEncrypt);
byte[] plain = crypt.TransformFinalBlock(cipher, 0, cipher.Length); // Here Error showing
Response.Write("Decryped string : " + System.Text.Encoding.UTF8.GetString(plain) + "<br/><br/><br/><br/>");
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
Here decryt function should be return decrypt string means Sample Input Text but its showing Bad Data error.
I give error screen shot also.
Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------
Bad Data.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Cryptography.CryptographicException: Bad Data.
Source Error:
Line 76: ICryptoTransform crypt = tdes.CreateDecryptor();
Line 77: byte[] cipher = FromHex(strEncrypt);
Line 78: byte[] plain = crypt.TransformFinalBlock(cipher, 0, cipher.Length); // Here Error showing
Line 79: Response.Write("Decryped string : " + System.Text.Encoding.UTF8.GetString(plain) + "<br/><br/><br/><br/>");
Line 80:
Source File: c:\Documents and Settings\tmani.MILESDNS01\My Documents\Visual Studio 2005\WebSites\WebSite1\SSoFinal.aspx.cs Line: 78
Stack Trace:
[CryptographicException: Bad Data.
]
System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) +33
System.Security.Cryptography.Utils._DecryptData(SafeKeyHandle hKey, Byte[] data, Int32 ib, Int32 cb, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode PaddingMode, Boolean fDone) +0
System.Security.Cryptography.CryptoAPITransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +200
SSoFinal.DecryptFunctionINGData() in c:\Documents and Settings\tmani.MILESDNS01\My Documents\Visual Studio 2005\WebSites\WebSite1\SSoFinal.aspx.cs:78
SSoFinal.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\tmani.MILESDNS01\My Documents\Visual Studio 2005\WebSites\WebSite1\SSoFinal.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68
System.Web.UI.Control.OnLoad(EventArgs e) +88
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3035
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
I would appreciate some help
Regards
Mani
|
|
|
|
|
Hy,
I m using query sring to pass value to another page. can any one tell me how to encrypt the query string value and then decrypt it on the other page
|
|
|
|