|
sir i have code for it in only c#, i am not able to implement this code in asp.net(c#), so any suggesion for it if give me
yogesh
|
|
|
|
|
OK, I'll try again. I'm a sucker for punishment.
If you have C# code for storing images, it will work in ASP.NET, because ASP.NET has NOTHING to do with your database, unless you choose to use really nasty ASP.NET controls that take SQL. Either way, the thing that won't work, is to pull images out of the db and embed them in a page. For this, they need to be on the file system. Which is why it's better to store the paths.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Actually, he can do it with [for example] httphandler, and still show it in the webform, they don't need to be on the file system.
|
|
|
|
|
Hi
Please check this site [^]. Even though the code is in VB.Net you will get the same properties and methods in C# also.
Retrieving the image can also be made from the same [site]
Regards
Meeram395
|
|
|
|
|
I knew that it was trivial to find info on this with google, but as he's using ASP.NET, what are the odds that he's storing images he doesn't want to show in a web page ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
just store the image path into database
And for retrive use this one ariticle
Retrive Image from database[^]
Happy Programming
-----
Abhijit
|
|
|
|
|
hope it helps..
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
its quite easy and not as complicated as u think.
im pasting the whole funny code here...use it as u like
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
public partial class SQLBinary : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//UploadImage();
}
public void UploadImage()
{
// Creating a bytearray[] from the input image
int ImgLen = FileUpload1.PostedFile.ContentLength;
string strSQL="";
byte[] FileImg = new byte[ImgLen];
FileUpload1.PostedFile.InputStream.Read(FileImg, 0, ImgLen);
// Inserting the image to DB
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connstr"].ToString());
try
{
con.Open();
strSQL = "INSERT INTO TESTIMAGE (EIMAGE) VALUES (@pic)";
SqlCommand cmd = new SqlCommand(strSQL, con);
cmd.Parameters.AddWithValue("@pic", FileImg);
cmd.ExecuteNonQuery();
}
finally
{
con.Close();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
UploadImage();
}
protected void Button1_Click(object sender, EventArgs e)
{
MemoryStream stream = new MemoryStream();
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connstr"].ToString());
try
{
con.Open();
SqlCommand command = new SqlCommand("SELECT EIMAGE FROM TESTIMAGE", con);
byte[] image = (byte[])command.ExecuteScalar();
stream.Write(image, 0, image.Length);
Bitmap bitmap = new Bitmap(stream);
//To SERVE
//Response.ContentType = "image/gif";
//bitmap.Save(Response.OutputStream, ImageFormat.Gif);
//TO SAVE
bitmap.Save(Server.MapPath("image")+ "/" + "aa.jpg");
Image1.ImageUrl = Server.MapPath("image")+ "/" + "aa.jpg";
}
finally
{
con.Close();
stream.Close();
}
}
}
Regards
Bino
http://www.codepal.co.nr
|
|
|
|
|
page1.aspx has link button. when you click linkbutton then it will open a popup window name page2.aspx.
1. when you click page2.aspx close button then it will close page2.aspx and refresh my page1.aspx
2. without closing page2.aspx you can not go back page1.aspx
how can i do it.
Thanks
Sarfarj Ahmed
|
|
|
|
|
Instead of just passing on the specification that you got, ask your own questions.
I could do your job for you, if you would pass on your paycheck too.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
i guess there is a modal option in window.popup in javascript.
something like showModalDialog
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
Default Need Help with ASP.NET implementation of FCKeditor
I've got a page with the FCKeditor on it. The editor works fine,
however, since there is no documentation on ASP.NET implementations, I
can't figure out how to access the editor text in my C# code-behind. I
was about to experiment with some javascript that would put the editor
text value into a hidden text field so I could access it but that seems
like a goofy way of doing it. Help anyone?
|
|
|
|
|
|
Hello
Anyone please Help me in Solving the bug.I used below code when run locally(i.e visual studio 2005) The mail is sending properly.Wheres i Host in the Server and run.Its giving problem that failure in sending mail.
IN webconfig file
<appSettings>
<add key="MyMailServer" value ="mail.a4mgroup.com"/>
<add key="MyMailServerPort" value ="25"/>
</appSettings>
in form
<%@ import Namespace="System.Net" %>
<%@ import Namespace="System.Net.Mail" %>
Dim mMailServer As String
Dim mTo As String
Dim mFrom As String
Dim mMsg As String
Dim mSubject As String
Dim mPort As Integer
Dim strMsg As String
strMsg = "<table><tr><td>Simple Mail</td></tr></table>"
mFrom = Trim("info@a4mgroup.com")
mSubject = Trim("Your Purchase Detail")
Dim strMessage As String = strMsg
strMessage = "<html><head><title></title></head><body>"
strMessage = strMessage & strMsg & "</body></html>"
mMsg = Trim("Dear") & " " & name
mMailServer = ConfigurationManager.AppSettings.Get("MyMailServer")
mPort = ConfigurationManager.AppSettings.Get("MyMailServerPort")
Dim message As New MailMessage(mFrom, mTo, mSubject, strMessage)
Dim mySmtpClient As New SmtpClient(mMailServer, mPort)
message.IsBodyHtml = True
mySmtpClient.Credentials = New System.Net.NetworkCredential("it@a4mgroup.com", "it123")
message.Priority = MailPriority.High
mySmtpClient.UseDefaultCredentials = True
mySmtpClient.Send(message)
Catch ex As FormatException
Label14.Text = ex.Message
Catch ex As SmtpException
Label14.Text = ex.Message
Catch ex As Exception
Label14.Text = ex.Message
Finally
myReader.Close()
myConnection.Close()
End Try
Thanks in advance
Regards
Ebenezer
|
|
|
|
|
1 - don't double post
2 - please tell me that you don't have a variable called label14 ?
3 - obviously ths means there's a problem with your mail server. Do you get any more detailed feedback ? This this a mail server that should just work anywere ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello
Anyone please Help me in Solving the bug.I used below code when run locally(i.e visual studio 2005) The mail is sending properly.Wheres i Host in the Server and run.Its giving problem that failure in sending mail.
IN webconfig file
<appsettings>
<add key="MyMailServer" value="mail.a4mgroup.com">
<add key="MyMailServerPort" value="25">
in form
<%@ import Namespace="System.Net" %>
<%@ import Namespace="System.Net.Mail" %>
Dim mMailServer As String
Dim mTo As String
Dim mFrom As String
Dim mMsg As String
Dim mSubject As String
Dim mPort As Integer
Dim strMsg As String
strMsg = ""
mFrom = Trim("info@a4mgroup.com")
mSubject = Trim("Your Purchase Detail")
Dim strMessage As String = strMsg
strMessage = "<title>"
strMessage = strMessage & strMsg & ""
mMsg = Trim("Dear") & " " & name
mMailServer = ConfigurationManager.AppSettings.Get("MyMailServer")
mPort = ConfigurationManager.AppSettings.Get("MyMailServerPort")
Dim message As New MailMessage(mFrom, mTo, mSubject, strMessage)
Dim mySmtpClient As New SmtpClient(mMailServer, mPort)
message.IsBodyHtml = True
mySmtpClient.Credentials = New System.Net.NetworkCredential("it@a4mgroup.com", "it123")
message.Priority = MailPriority.High
mySmtpClient.UseDefaultCredentials = True
mySmtpClient.Send(message)
Catch ex As FormatException
Label14.Text = ex.Message
Catch ex As SmtpException
Label14.Text = ex.Message
Catch ex As Exception
Label14.Text = ex.Message
Finally
myReader.Close()
myConnection.Close()
End Try
Thanks in advance
Regards
Ebenezer
|
|
|
|
|
Have you figured this out yet?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I need to create T-shirt design web site in asp.net 2.0 .
i want to use ajax.
Any one have any idea about this?
can you suggest any reference .net website?
any one have part of the source code?
|
|
|
|
|
What do you mean by t-shirt design ? How is this something that should be done via a website ?
How do you want to use AJAX ? Do you even know what it is, or does it just sound cool ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Users should pick the t-shirt template and they can able to add pictures & text from the list.
Something similar to www.click-shirt.com .
I think its possible in ajax.
Any idea plz?
|
|
|
|
|
Your first step would be to understand things like AJAX before you start talking about them. No, you can't make a site like that with AJAX. That site is driven by flash. Do you know what AJAX is/means ? You could write a website for designing a t-shirt and use AJAX, of course. It would not look like the site you linked to.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
I am trying to update two table in a single query but its not working.
My query is as follow.
update Blog_Post,Blog_New set Blog_Post.Posttitle='This is post for database blog(updated)',Blog_Post.editeddate=getdate(),Blog_New.editeddate=getdate() where Blog_Post.blgid=Blog_New.blgid and Blog_Post.postid='4'
When i run this query in query analyzer it gives incorrect syntax near ','.. where i am going wrong please tell me.
Thanks.
Rahul
People Laugh on me Because i am Different but i Laugh on them Because they all are same.
|
|
|
|
|
rahul.net11 wrote: Hi
I am trying to update two table in a single query but its not working.
You can't do that. Instead:
update Blog_Post set Blog_Post.Posttitle='This is post for database blog (updated)',Blog_Post.editeddate=getdate()<br />
where Blog_Post.postid='4'<br />
update Blog_New set Blog_New.editeddate=getdate()<br />
where Blog_New.blgid in (select Blog_Post.blgid from Blog_Post where Blog_Post.postid='4'
If you want to ensure consistency, use this inside of a transaction.
|
|
|
|
|
Thanks For help its working?
Can u tell me how can i use this inside transaction?
People Laugh on me Because i am
Different but i Laugh on them
Because they all are same.
|
|
|
|
|
I use code for signout is:-
FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
It redirect to login page.
But, my problem is that when I click at back icon,
it goes to privious page (like as after signin)..........
In web.config, I used Forms Authentication with name="COOK" loginUrl="Default.aspx".
How we can remove that problem ..
ajai
|
|
|
|