|
Be careful - Depending on what the value is this can be a major security hole as it can easily be changed by the user.
|
|
|
|
|
Yes Colin
Yes you are absolutely right but we don’t know for his application user have security as an issue or not. I showed only where he was wrong. But any way thanks for suggestion
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Yes, but that is true for any value that you get from the request.
Input is evil.[^]
---
single minded; short sighted; long gone;
|
|
|
|
|
I am an application programmer working in a private firm.I am now working on a project.
The prject is related to survey.So for this we have to genarate a word reaport after completing every survey.For this we run a vbscript file with scheduler.But the problem is
that it takes 45 minutes time to genarate every reaport.But the critical problem is that
when 9 user are put there survey at the same time then they have to wait for 9-15 hours.
So please give me the solution how can I speed up the time for reaport genaration using
.net.
Golam Md. Mostafa
Application Programmer
Web Spiders (India) Pvt. Ltd.
51B, Justice Chandra Madhav Road,
Calcutta - 700020, India
Cell: +91.92319.01511
Tel: +91.33.2474 3581
Fax: +91.33.2474 3500
Email: golam.mostafa@webspiders.com
URL: http://www.webspiders.com
- A Microsoft Gold Certified Partner and an ISO 9001:2000 certified company - INDIA . UK . USA
|
|
|
|
|
Tune your sql queries.
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Hi to All,
Anybody Tell me what is the Different between .NET 2005 AND .NET 2003.
Mohan Balal
|
|
|
|
|
there is no .net2003/5, only .net 2.0/3.0 which is the sdk for u to write applications.
Maybe u mean visual studio .net/ visual studio 2005, the latter is the later version embedded .net sdk 2.0
|
|
|
|
|
Ask our friend google!
You would find enough differences and new features in 2005
Gautham
|
|
|
|
|
Try to write a subject that better describes your question.
Visual Studio 2003 targets .NET framework 1.1, and Visual Studio 2005 targets .NET framework 2.0. That's the most distinguishing difference, other than that there are just a lot of small features added to VS 2005. As gauthee said, you can search the web to find information about these, that's the best way of finding answers to general questions like this. A forum like this is better suited for answering more specific questions.
---
single minded; short sighted; long gone;
|
|
|
|
|
Image img1 = getImage("select picture from database where id=1");
Image img2 = getImage("select picture from database where id=2");
pnl1.Controls.add(img1);//for example. not working;
pnl1.Controls.add(img2);
please help me for putting this images in part of page;
We Can Do Anything, If We Want It
|
|
|
|
|
YOu got to convert the image right! when you say select image it would not simply return imageinstead it returns binary data
Gautham
|
|
|
|
|
i know that is return binary data.
and i know how to convert binary data to image.
but i dont know how to put converted image to page on the fly without saving images in any folder?
We Can Do Anything, If We Want It
|
|
|
|
|
You can use a MemoryStream:
<br />
private static int chunkSize = 10000;<br />
private void writeData(object yourImageBinaryData){<br />
MemoryStream ms = null;<br />
int dataLeft = 0;<br />
<br />
try<br />
{<br />
dataLeft = ((byte[])yourImageBinaryData).Length;<br />
ms = new MemoryStream((byte[])yourImageBinaryData);<br />
<br />
while(dataLeft > 0 && Response.IsClientConnected)<br />
{ <br />
byte[] currentChunk = new byte[chunkSize];<br />
int currentChunkSize = ms.Read(currentChunk, 0, chunkSize);<br />
<br />
Response.BinaryWrite(currentChunk);<br />
<br />
dataLeft -= currentChunkSize;<br />
currentChunk = null;<br />
}<br />
}<br />
catch(Exception e){<br />
throw new Exception("writeData failed. " + e.Message);<br />
}finally{<br />
if (ms != null)ms.Close();<br />
ms = null;<br />
}<br />
}<br />
Hope it helps
Thomas
|
|
|
|
|
thank's for you.
but i want put all image for one user in the page
and Response.BinaryWrite or Response.OutputStream dose not Suport this
We Can Do Anything, If We Want It
|
|
|
|
|
You could putt each image in DataGrid, repeater, listcontrol.
You could also create your own class that contains the image from the database.
Something like this:
First create an empty .aspx page
<%@ Page language="c#" Codebehind="MyImageClass.aspx.cs" AutoEventWireup="false" Inherits="My.Publishing.MyImageClass" %><br />
The code behinde:
using System;<br />
using System.IO;<br />
using System.Drawing.Imaging;<br />
using Millum.Procurement.Imaging;<br />
using System.Runtime.Serialization;<br />
using System.Runtime.Serialization.Formatters.Binary;<br />
using System.Web;<br />
using System.Web.Caching;<br />
using System.Collections;<br />
namespace My.Publishing{<br />
public class MyImageClass : System.Web.UI.Page{<br />
private static int chunkSize = 10000;<br />
override protected void OnInit(EventArgs e){<br />
InitializeComponent();<br />
base.OnInit(e);<br />
}<br />
private void InitializeComponent(){<br />
uploadData();<br />
}<br />
private void uploadData(){<br />
string strID = null;<br />
<br />
strID = (Request.QueryString["attID"] != null)?Request.QueryString["attID"]:(Request.Form["attID"] != null)?Request.Form["attID"]:null;<br />
<br />
byte[] byteImg1 = getImage("select picture from database where id=" + strID );<br />
<br />
writeData(byteImg1);<br />
}<br />
<br />
<br />
private void writeData(byte[] yourImageBinaryData){<br />
MemoryStream ms = null;<br />
int dataLeft = 0;<br />
<br />
try<br />
{<br />
dataLeft = yourImageBinaryData.Length;<br />
ms = new MemoryStream(yourImageBinaryData);<br />
<br />
while(dataLeft > 0 && Response.IsClientConnected)<br />
{ <br />
byte[] currentChunk = new byte[chunkSize];<br />
int currentChunkSize = ms.Read(currentChunk, 0, chunkSize);<br />
<br />
Response.BinaryWrite(currentChunk);<br />
<br />
dataLeft -= currentChunkSize;<br />
currentChunk = null;<br />
}<br />
}<br />
catch(Exception e){<br />
throw new Exception("writeData failed. " + e.Message);<br />
}finally{<br />
if (ms != null)ms.Close();<br />
ms = null;<br />
}<br />
}<br />
<br />
Now the page where the images is viewed, this is an example with
a DataGrid, where the image is displaide in a imagebutton:
<br />
asp:datagrid id="dgImages" runat="server" CssClass="grid" AutoGenerateColumns="False" GridLines="None"<br />
ShowFooter="True"><br />
SelectedItemStyle Font-Bold="True" CssClass="grid_itemSelected"></SelectedItemStyle><br />
EditItemStyle CssClass="grid_itemEdit"></EditItemStyle><br />
AlternatingItemStyle CssClass="grid_itemAlternating"></AlternatingItemStyle><br />
ItemStyle CssClass="grid_item"></ItemStyle><br />
HeaderStyle Font-Bold="True" CssClass="grid_header"></HeaderStyle><br />
FooterStyle CssClass="grid_footer"></FooterStyle><br />
Columns> <br />
asp:TemplateColumn ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Top"><br />
ItemTemplate><br />
asp:ImageButton ID="imgFT" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "lngImageID").ToString()%>' AlternateText="Show/Download$" CausesValidation="True"><br />
/asp:ImageButton><br />
/ItemTemplate><br />
/asp:TemplateColumn><br />
/Columns><br />
/asp:datagrid><br />
Then you need a ItemCreated method for the datagrid:
<br />
#region Web Form Designer generated code<br />
override protected void OnInit(EventArgs e)<br />
{<br />
InitializeComponent();<br />
base.OnInit(e);<br />
}<br />
<br />
private void InitializeComponent()<br />
{<br />
this.dgImages.ItemCreated += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgImages_ItemCreated);<br />
this.Load += new System.EventHandler(this.Page_Load);<br />
<br />
}<br />
#endregion<br />
<br />
private void dgImages_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)<br />
{ <br />
try <br />
{<br />
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) <br />
{<br />
DataRowView drv = (DataRowView) e.Item.DataItem; System.Web.UI.WebControls.ImageButton img = new ImageButton();<br />
img = (System.Web.UI.WebControls.ImageButton)e.Item.FindControl("imgFT");<br />
img.Click += new System.Web.UI.ImageClickEventHandler(btnImage_Click); <br />
if(drv != null)<br />
{<br />
int lngImageID = Convert.ToInt32(drv.Row["ID"]);<br />
img.BackColor = Color.Transparent;<br />
img.BorderStyle = BorderStyle.None;<br />
<br />
img.ImageUrl = "../MyImageClass.aspx"?attID=" + lngImageID.ToString();<br />
}<br />
catch (Exception err) <br />
{<br />
}<br />
}<br />
Ofcource you now have to get all the imageIDs from the user:
<br />
DataVies dvAllImageIDs = getAllImageIDsForTheUser();<br />
dgImages.DataSource = dvAllImageIDs;<br />
dgImages.DataBind();<br />
This code is bits and pizes of a hole bigger control, so theres
probably some errors, but you get the point.
Hope it helps
Thomas
-- modified at 4:42 Tuesday 17th April, 2007
|
|
|
|
|
how to create a javascript menubar?
|
|
|
|
|
Hope this Script may help you.
var xcNode = [];<br />
<br />
function xcSet(m, c) {<br />
if (document.getElementById && document.createElement) {<br />
m = document.getElementById(m).getElementsByTagName('ul');<br />
var d, p, x, h, i, j;<br />
for (i = 0; i < m.length; i++) {<br />
if (d = m[i].getAttribute('id')) {<br />
xcCtrl(d, c, 'x', '[+]', 'Show', m[i].getAttribute('title')+' (expand menu)');<br />
x = xcCtrl(d, c, 'c', '[-]', 'Hide', m[i].getAttribute('title')+' (collapse menu)');<br />
<br />
p = m[i].parentNode;<br />
if (h = !p.className) {<br />
j = 2;<br />
while ((h = !(d == arguments[j])) && (j++ < arguments.length));<br />
if (h) {<br />
m[i].style.display = 'none';<br />
x = xcNode[d+'x'];<br />
}<br />
}<br />
<br />
p.className = c;<br />
p.insertBefore(x, p.firstChild);<br />
}<br />
}<br />
}}<br />
<br />
<br />
function xcShow(m) {<br />
xcXC(m, 'block', m+'c', m+'x');<br />
}<br />
<br />
<br />
function xcHide(m) {<br />
xcXC(m, 'none', m+'x', m+'c');<br />
}<br />
<br />
<br />
function xcXC(e, d, s, h) {<br />
e = document.getElementById(e);<br />
e.style.display = d;<br />
e.parentNode.replaceChild(xcNode[s], xcNode[h]);<br />
xcNode[s].firstChild.focus();<br />
}<br />
<br />
<br />
function xcCtrl(m, c, s, v, f, t) {<br />
var a = document.createElement('a');<br />
a.setAttribute('href', 'javascript:xc'+f+'(\''+m+'\');');<br />
a.setAttribute('title', t);<br />
a.appendChild(document.createTextNode(v));<br />
<br />
var d = document.createElement('div');<br />
d.className = c+s;<br />
d.appendChild(a);<br />
<br />
return xcNode[m+s] = d;<br />
}<br />
Regards,
Satips.
|
|
|
|
|
hai
i used this script,then i run this script means showing blank in screen.but no error shown.so plz help.
|
|
|
|
|
http://www.dynamicdrive.com/dynamicindex1/
http://inspire.server101.com/js/mb/
Gautham
|
|
|
|
|
Hi Guys,
I am using the ready made rss code for my site.The problem is that the feeds opens in the same page of my site.I want it to open in a separate page
The rss coding is in the format
If anybody have the coding or suggestions kindly reply.
Thanks
Jith
|
|
|
|
|
Hi all...
How to disable a potion without getting selected in the dropdownlist. See the this http://www.naukri.com/tieups/tieups.php?othersrcp=945 go to Current Location* Dropdownlist, there we can able select the location only not the state names. plz tell me how to do that, its urgent help me.......
Pradeep Reddy
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = commonfunctions.fillCategory(1);
}
public static DataTable fillCategory(int catID)
{
DataTable dt = new DataTable();
dt.Columns.Add("CATEGORY_ID", typeof(int));
dt.Columns.Add("CATEGORY_NAME", typeof(string));
dt.Columns.Add("LEVEL", typeof(int));
dt.Columns.Add("PARENT_CATEGORY", typeof(int));
dt = commonfunctions.fillCat(catID, dt, 0);
return dt;
}
public static DataTable fillCat(int catID, DataTable dt, int i)
{
DataTable currdt = new DataTable();
DataTable cdt = new DataTable();
DataTable ccdt = new DataTable();
string query;
query = "SELECT CATEGORY_ID, CATEGORY_NAME, PARENT_CAT_ID FROM CATEGORY_MASTER WHERE CATEGORY_ID = " + catID;
currdt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionString, CommandType.Text, query);
string name = currdt.Rows[0][1].ToString();
for (int cnt = 0; cnt < i; cnt++)
{
name = "-" + name;
}
dt.Rows.Add(currdt.Rows[0][0], name, i, currdt.Rows[0][2]);
query = "SELECT CATEGORY_ID, CATEGORY_NAME FROM CATEGORY_MASTER WHERE PARENT_CAT_ID = " + catID ;
cdt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionString, CommandType.Text, query);
foreach (DataRow drc in cdt.Rows)
{
query = "SELECT COUNT(*) FROM CATEGORY_MASTER WHERE PARENT_CAT_ID = " + catID ;
ccdt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionString, CommandType.Text, query);
if (Convert.ToInt32(ccdt.Rows[0][0].ToString()) > 0)
{
i++;
dt = fillCat(Convert.ToInt32(drc[0].ToString()), dt, i);
i--;
}
else
{
name = drc[1].ToString();
i--;
for (int cnt = 0; cnt < i; cnt++)
{
name = "-" + name;
}
dt.Rows.Add(drc[0], name, i, catID);
}
}
i--;
return dt;
}
---------------------------------------
Here I have just one table.
Category_Master
And Column are :
Category_id
Category_Name
Parent_Category_ID
Join condion is self join.
You can change query and join condtion as per your data.
Regards,
Mayank Parmar
Senior Software Engineer
Amba Tech
Gandhinagar, India
|
|
|
|
|
All the state name values are "select". So the code may be checking if the value is not "select" accept the value. Please try it out with this logic
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
hi guys i am currently using asp.net2 c# to make a website
however i realise i needed some ajax controls so i installed the nessary files
and added the controls( script manager and calender extension)
altohuhg the page run but when the button is click and the date selector is not displayed anyone know y?
|
|
|
|
|
Hi All,
I need to Redirect the page using JavaScript.Is it Possible.If Please Help me.
Thanks and Regards
Narendra
|
|
|
|
|