|
bhavnvyas wrote: this code is not workin
Try this One..!
http://www.codeproject.com/KB/database/transactions.aspx
|
|
|
|
|
but i am using mysql
its not going in my catch for rollback....
|
|
|
|
|
Great ..! Then the Query may change ..!
I dont know much abt mysql..! Check tht it supports with this code..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
|
Dont get Too Confuse..!
Ask the same question to the author who wrote the article..!He May Help You..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
|
With Eval function, i am able to parse JSON string in IE and Chrome. But i am not able to parse json string using Eval function in Firefox. Can you please give the code to solve this problem.
|
|
|
|
|
Are you parsing JSON in client?
What error you are getting. Can you show the JSON string ?
Are you doing like this
var jsonOBJ = eval('(' + data + ')');
I think it works in Firefox as well..
|
|
|
|
|
this is my json string. I am using the eval function the same you have show.
Example of json string
{"Store":[{"Store_id":1325,"StoreName":"s1","StoreCode":1}]}
|
|
|
|
|
But when I try this, it works perfectly in firefox as well.. .
I used
function elemJSON() {
var elem = '{ "Store": [{ "Store_id": 1325, "StoreName": "s1", "StoreCode": 1}] }';
var jsonobj = eval('(' + elem + ')');
alert(jsonobj.Store[0].Store_id);
}
<br />
<input type="button" onclick="elemJSON();" value="JSON Parse" />
and it showed me 1325 in both the browsers(IE And FF)...
|
|
|
|
|
thanx a lot abhisekh, it worked...
|
|
|
|
|
pavankumarchakilam wrote: thanx a lot abhisekh
Here Its a Tradition to mark it as answer if it worked for u..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi Coders
My Problem is that Image store in database in binary format and I want to display in a gridview but unable 2 do so.
If u do this with use of LINQ that is best for me.Anyway u are free to do this with any method.
any help would be appreciated
Thanks
Amit Gautam
|
|
|
|
|
gautamamit8 wrote: f u do this with use of LINQ that is best for me.
Then You have to post in job task..!This forum is for helping to others not to do their work ..!
If You are stuck with some where then we can help you..!
What You had done until now ..?Where did you stuck..!
try this link..!
Displaying Image in Gridview from Database[^]
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Till now I store the single image in binary format in database. Even , I can show the image from database single but I dont know how to show them in Grid.
The Article Link u given to me is for display image via using path of the Image not in binary format.So that is not helpful and Secondly I'm not here to get complete my work from others I just need a help or a point where i can solve my problem.
Thanks for urs kind interest
Amit
|
|
|
|
|
|
|
|
What is the error that you are getting??
|
|
|
|
|
He did not get any error because he dont know how to start..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
//upload image
public void OnUpload(Object sender, EventArgs e)
{
int len = Upload.PostedFile.ContentLength;
byte[] pic = new byte[len];
Upload.PostedFile.InputStream.Read (pic, 0, len);
SqlConnection connection = new
SqlConnection (@"server=INDIA INDIA;database=iSense;uid=sa;pwd=india");
try
{
connection.Open ();
SqlCommand cmd = new SqlCommand ("insert into Image "
+ "(Picture, Comment) values (@pic, @text)", connection);
cmd.Parameters.Add ("@pic", pic);
cmd.Parameters.Add ("@text", Comment.Text);
cmd.ExecuteNonQuery ();
}
finally
{
connection.Close ();
}
}
//load image
private void Page_Load(object sender, System.EventArgs e)
{
MemoryStream stream = new MemoryStream ();
SqlConnection connection = new
SqlConnection (@"server=INDIA INDIA;database=iSense;uid=sa;pwd=india");
try
{
connection.Open ();
SqlCommand command = new
SqlCommand ("select Picture from Image where id"], connection);
byte[] image = (byte[]) command.ExecuteScalar ();
stream.Write (image, 0, image.Length);
Bitmap bitmap = new Bitmap (stream);
Response.ContentType = "image/gif";
bitmap.Save (Response.OutputStream, ImageFormat.Gif);
}
catch
{
string strblandImagePath = Server.MapPath("");
strblandImagePath += "NoImg.gif";
FileStream FileBlandImagestream = File.OpenRead(strblandImagePath);
Bitmap bitImage = new Bitmap(FileBlandImagestream);
Response.ContentType = "image/gif";
bitImage.Save(Response.OutputStream, ImageFormat.Gif);
}
finally
{
connection.Close ();
stream.Close ();
}
}
modified 27-May-14 5:11am.
|
|
|
|
|
Hi all,
I am sending id to the another page but right now it is in readable format how to encrypt.
Thanks,
Amit Patel
|
|
|
|
|
This was enormously helpful code to me. I searched forever to find something this straightforward. You saved me many hours.
I wanted to add something another reader might find useful. I needed to add URL encoding so that the encrypted string would be ready for transport over HTTP. To do this (in vb.net) I add a reference to System.Web and use the HTTPUtility.URLEncode class to transform it into a string
Imports System.Web
strEncoded = HttpUtility.UrlEncode(strEncrypted)
So, the steps are:
1. Store a string of query parameters
2. Encrypt it using code above
3. Encode it with URLEncode
4. Send it through as query string (one string of apparently-random characters)
5. Receive it on the other side as one big query string
6. use HTTP.Utility.URLDecode to get it back to a regular string
6. Decrypt it using the code above
7. Write a routine to parse it out because you can't use Request.QueryString("AB") for this purpose. You have to come up with your own such as request_equerystring("AB"). Some code for this was written up in the following article on the subject that talks about the process but I could not get their encrypt and decrypt to work out-of-the-box in vb.net.
In my application, the data I am passing can only be obtained using a windows.form because it uses local data that is not brower-accessible. There are plenty of examples of ASP to ASP querystring passing out there where you can use server.transfer. But, this is the only simple-to-follow reference I could find to calling up a browser with encrypted query strings from vb.net (that worked on first try).
Encrypting the Information Passed From the Query String
|
|
|
|
|
Why not just provide the link to original content instead of copying and pasting it here?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
its in my computer buddy in my txt file if you want thn i'll send it to you........and i am using it in my app....
|
|
|
|