|
HI
If you want to get the image from the database which is in the bytes and want to show on aspx page in image control ok
then you can do that what you have to do is first get the image from the database and store it in some temporary folder with extension jpg for that you have to do some conversion look at the code below
System.Drawing.Image newImage;
SqlConnection conn = null;
SqlCommand cmd = null;
DataSet ds = new DataSet();
SqlParameter UserNamedb = null;
SqlParameter AlbumNamedb = null;
conn = new SqlConnection(ConnectionString);
conn.Open();
cmd = new SqlCommand("GetAlbum", conn);
cmd.CommandType = CommandType.StoredProcedure;
UserNamedb = new SqlParameter("@UserName", SqlDbType.VarChar);
UserNamedb.Value = "SandeepAkhare";
cmd.Parameters.Add(UserNamedb);
AlbumNamedb = new SqlParameter("@AlbumName", SqlDbType.VarChar);
AlbumNamedb.Value = "ccccccccccccc";
cmd.Parameters.Add(AlbumNamedb);
SqlDataAdapter ad = new SqlDataAdapter(cmd);
ad.Fill(ds);
conn.Close();
string path = @"c:\AlbumFromdatabase" + "\\" + "SandeepAkhare";
Directory.CreateDirectory(path);
foreach (DataRow dr in ds.Tables[0].Rows)
{
Byte[] imageData = (byte[])dr[0];
string FilaName = dr[1].ToString();
using (MemoryStream ms = new MemoryStream(imageData, 0, imageData.Length))
{
ms.Write(imageData, 0, imageData.Length);
// newImage = Image.FromStream(ms, true);
Bitmap bm = new Bitmap(new MemoryStream(imageData));
newImage = bm;
newImage.Save(path + "\\" + FilaName);
}
}
|
|
|
|
|
Perhaps you should reply to the OP instead of replying to my reply.
---
b { font-weight: normal; }
|
|
|
|
|
|
Dear all,
My issue is that I don't want to submit the form is the checkbox isn't checked and i want to make it through validators
which validator should i use and how?
Best Regards
3ala2
|
|
|
|
|
|
i know!!!
But i can't control the button action
because i have other validators in the form
so i can do both together
anyway, i'm workin on something guess it should work...
Thanx for replying
Best Regards
3ala2
|
|
|
|
|
validation contrlos are predefined.genrally works on text boxes.it is not possible as per user by validation controls.if u realy want to validate u have to write seperate logic for that.by using script lagu..
|
|
|
|
|
I did it...
var ucName = "UcPayToAccountant1_";
function jsValidate()
{
if ( checkAmount() && checkDone() )
{
Page_ClientValidate();
return true;
}
else
{
return false;
}
} // End Function
function checkAmount()
{
var amount = document.getElementById(ucName + "txtAmount").value;
if ( isNaN(amount) )
{
return false;
}
else
{
return true;
}
} // End Function
function checkDone()
{
var done = document.getElementById(ucName + "chkDone");
if (done.checked)
{
return true;
}
else
{
return false;
}
} // End Function
added the onclick attribute the button
so using Page_ClientValidate(); function which the validator generates solved the probelm
Best Regards
3ala2
|
|
|
|
|
Hi,
I have created a web service(service.asmx). I have used basic windows authentication for web service. Please see my code which i had written in code behind.
TestWebService.Service ObjSer = new TestWebService.Service();
ObjSer.Credentials = CredentialCache.DefaultCredentials;
Label1.Text=ObjSer.HelloWorld().ToString();
But i got the following error...
"The request failed with HTTP status 401: Access Denied."
Could u please advise what is wrong with me?
Bye,
Poovarasan
|
|
|
|
|
Hi,
In page1, I am listing employee names in drop down list and selecting some name from the list. I am having one linkbutton in that page. when i click that button it takes to other page2 thro response.redirect. From that page2 when i click home link it comes back to page1 and in this page1 i have to retain the same value in dropdownlist but it shows only the first listitem in the dropdownlist. Please Help.
Thanks in Advance.
Regards,
Prya
|
|
|
|
|
When you fill DropDownList fill it inside Page_Load event use !Page.IsPostBack
example
<br />
if (!Page.IsPostBack)<br />
{<br />
}
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
Yes I am filling the list only in Page_Load under!(IsPostBack). My Code:
if (!(IsPostBack))
{
ddlEmpName.DataSource = loadEmployee;//loadEmployee-DataSet
ddlEmpName.DataTextField = "EmpName";
ddlEmpName.DataValueField = "EmpName";
ddlEmpName.DataBind();
}
Prya
|
|
|
|
|
Hi prya
write this code after bind Dropdown list.
DD.Items.FindByText(session["item"], String).ToString).Selected = True
U have to store selected item in session["item"]
Pathan
|
|
|
|
|
Why __VIEWSTATE comes in querystring?
Anyone have any idea and please reply as soon as. This is very urgent.
Thanks in Advance.
Regards
R.Arockiapathinathan
|
|
|
|
|
Hahaha, how can this be urgent... Viewstate can be a very very very powerfull tool for developing ASP.NET webpages. But you can switch them off using the page's EnableViewState property... is that quick enough for you??
|
|
|
|
|
I switched off enableviewstate in page level. But still getting viewstate hidden control.
And in our website, we are getting error log, it gives the request url, it says ....aspx?__viewstate=/.......
We never use postback option in all our pages. So how come this is possible?
Is it any hack attack?
Regards
R.Arockiapathinathan
|
|
|
|
|
Because you have changed the method of the form from POST to GET.
---
b { font-weight: normal; }
|
|
|
|
|
Hi ,
I am Ravindra, presently working with DataGrid control.
I added a checkbox column to my Datagrid control and like to delete rows which are checked.
So please help , how to get a particular row when the datagrid checkbox is checked.
This is the code I implemented
foreach(DataGridItem dgi in DataGrid1.Items)
{
CheckBox cb=(CheckBox)dgi.FindControl("CheckBox1");
if(cb.Checked==true)
{
}
}
thanks in advance...
-- Ravindra
|
|
|
|
|
do some modifications, like
if ctype(dgi.findcontrol("...").checked then
........
|
|
|
|
|
There is an error occured stating
Error Type:
Server object, ASP 0177 (0x8002801D)
Library not registered.
/includes/inc_FileUtilities.asp, line 28
In line 28 i write the coding like this
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Plz give me the solution
DPM
|
|
|
|
|
This sounds like a good old ASP error in stead of an ASP.NET error...
It means your webserver does not know the FileSystemObject class (which is pretty strange though)
If you're using ASP.NET, you meight consider using the System.IO namespace for using the same functionality, if you ARE using ASP.NET, make sure you have the correct DLL (Which should be a scripting COM object or so, i don't know anymore, too long ago) and register is by typing regsvr32 in a command prompt followed by the filename
<br />
regsvr32 c:\path\to\scripting.dll<br />
|
|
|
|
|
when calling a url through xmlHttp repeatedly using setInterval
to perform some operation on database .But it is functioning correctly when setting a break point on the url page other wise it wont executing.
|
|
|
|
|
hi fraiends I am working in asp.net2.0 C#.I want to generate button click event from javascript.when i used normal page it works fine but when i took it in master page event is not fired.
Firest line is working fine and second line in script says object expected
the codes which i tried are
script
document.getElementById('ctl00_content1_PageNumber').value=id;
_doPostBack(PageClick'),' ');
************my text and button name *********
<asp:button id="PageClick" onclick="Page_Click" runat="server" name="PageClick" visible="true">
*******************************************************************************************
script
document.getElementById('ctl00_content1_PageNumber').value=id;
_doPostBack(document.getElementById('ctl00_content1_PageClick'),'');
************my text and button name *********
<asp:button id="PageClick" onclick="Page_Click" runat="server" name="PageClick" visible="true">
*******************************************************************************************
|
|
|
|
|
I'm writing a custom web component in VB and Javascript, using VS 2003. I originally wrote the same thing as a user component, but didn't like the big gray box it displayed in the designer.
I'm going to use this component in a very populated webpage, and the big gray box would make it hard to align everything in the designer.
So now that I've almost finished the custom web component, when does it blosum into a component that looks like it will in the browser?
At the very least, how do I control the width of the "[cwcComboBox "cwcComboBox]" thing to reflect the actual width of the component I set using the properties panel, so I can put them on my web form and see where all of the components should actually go? I want the components to work in flow, which I concentrating on right now, and absolute positioning, too.
Thank you.
|
|
|
|
|
I thought of another possiblility, which I don't know if or how to do, but if the actual compoents I use to render my custome web component can't be displayed and the width of the [xxx "xxx"] stand-in for my component in the designer can't be control'ed, can my component render and alternative component in the designer. Basically, my component is a combobox, so if I can render a select list in the designer, that would work fine for me.
Thanks.
|
|
|
|