|
sorry......
i m new to this...
actually i have done that how to copy from one radgrid to another...
this is my code..plz can u help me in converting it...
SqlConnection con = new SqlConnection("Data Source=CMA-PC; Initial Catalog= master; Integrated Security=True");
SqlDataAdapter da = new SqlDataAdapter("select * from aa1 where Journal_Name='" + DropDownList1.Text + "'", con);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
DataRow dr;
dr = dt.NewRow();
GridView1.DataSource = dt;
//GridView1.DataBind();
foreach (GridViewRow r in GridView1.Rows)
{
/* Construct datatable from Existing GridView */
DataRow newrow = dt.NewRow();
newrow[0] = r.Cells[0].Text;
newrow[1] = r.Cells[1].Text;
newrow[2] = r.Cells[2].Text;
newrow[3] = r.Cells[3].Text;
newrow[4] = r.Cells[4].Text;
newrow[5] = r.Cells[5].Text;
newrow[6] = r.Cells[6].Text;
newrow[7] = r.Cells[7].Text;
newrow[8] = r.Cells[8].Text;
newrow[9] = r.Cells[9].Text;
newrow[10] = r.Cells[10].Text;
newrow[11] = r.Cells[11].Text;
/* Add to Datatable */
dt.Rows.Add(newrow);
}
/* Finally Bind the Constructed DataTable to Grid2 */
GridView2.DataSource = dt;
DataBind();
}
|
|
|
|
|
First the newbie mistakes need to be corrected. NEVER hard-code you connection strings in your code, use the web.config file. There is a section for connection strings. NEVER use string concatenation to form to the sql statement and NEVER, EVER use unvalidated values from user input.
If I understand this you want GridView1 and GridView2 to have the same data?
GridView1.DataSource = GridView2.DataSource = dt;
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I want to input below code.
But page occur error.
How can i?
<td> Time & Destination </td>
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
Haha, having trouble atm getting this to display correctly as CP keeps converting it...
You need to replace the "&" with "&" - this is the HTML escape code for an ampersand character. For a full list, see here[^].
|
|
|
|
|
|
Escape codes are a bugger to remember aren't they!
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hey...I am new to this MVC 2.0.I just want to know what are the codes to download a File from database using MVC 2.0.I am using ADO.NET Entity Framework.
I am confused with layers of MVC 2.0.It has Domain(Abstract,Concrete,Entity) and WebUI.How I will use this layers to download a file.
Thanks in advance.
|
|
|
|
|
Hi,
I am not sure if this is possible. I am exploring web user controls. I have created a datalist user control (datalist.ascx). I have added this control to my default page. Now I want to bind data to this datalist. I am not sure how to do that. I am testing with user controls and any help will be appreciated.
Here is my code:
default.aspx
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Default" title="Untitled Page" %>
<%@ Register Src="datalist.ascx" TagName="datalist" TagPrefix="uc1" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>;
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<uc1:datalist ID="Datalist1" runat="server" />
</asp:Content>
default.aspx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim cmd As New SqlCommand("ws_Testimonials")
Try
If dalaccess.Connect = True Then
rs1 = dalaccess.GetDataset(cmd, 60)
dalaccess.Disconnect()
Datalist1.datasource = rs1
Datalist1.DataBind()
End If
Catch ex As Exception
End Try
I get the compilation error that "Error 1 'datasource' is not a member of 'ASP.datalist_ascx'."
Gurus please help.
|
|
|
|
|
Just expose the Datalist of your usercontrol using properties. Once done, they will be accessible in the base page and there you can directly access and define the datasource for it.
|
|
|
|
|
Hi,
I want to log messages in event viewer from my ASP application.
Does anybody have an idea how do it?
Cheers
|
|
|
|
|
ASP or ASP.NET? If it's ASP.NET, you need the EventLog[^] class which contains various members for manipulating the event log. For instance, if you want to log to your own event source (there are certain sources already created such as the Application log and Security log), you'd use:
if (!EventLog.SourceExists("MyCustomSource"))
{
EventLog.CreateEventSource("MyCustomSource");
} Then, you can write to it using:
<br />
EventLog.WriteEntry("MyCustomSource", "This is my event body text", EventLogEntryType.Information); There are various overloads for this method - have a read up to find which is best in your particular case. Note that you shouldn't attempt to create an event source and then use it immediately, as there is a time period that the event source is being created. If you must do this, make sure that you create the event source when the application starts.
You also need to be aware that writing to the event log requires security privileges that your web account may not, by default, have. In this case, the administrator will need to ensure that the web account has privileges to write to the event log.
|
|
|
|
|
Hi all,
I am createing a report in SSRS 2008. When i select the pagebreak option then it is creating multiple tabs for each group.
but I want all the data in the single sheet instead of different tab with page break.
any solution?
Thanks in Adv
Rahul
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
rahul.net11 wrote: When i select the pagebreak option then it is creating multiple tabs for each group.
You have not mentioned that which control you are using. Based on this, it looks like it's a List. You have very specific options for page break here. Tried all?
rahul.net11 wrote: but I want all the data in the single sheet instead of different tab with page break.
After reading this, it sounds like, you want a page break during a print and not as such. If so, it will automatically happen based on printing settings (generally page height-width). PageBreak feature is to segregate few data from each other and start the display of them afresh. Looks like it's happening the same for you but your reason to put page break is not so. Read on what 'Page Break' feature is and what it provides.
|
|
|
|
|
hi
how to validate fax number using regular expression validator in asp.net, that should accept
541-000-4444
(541) 000-4444
1-222-000-4444
1 (222) 000-4444
|
|
|
|
|
|
Hi Im using ASP.net / C#
My english is not very good, but i will try my best to explain what i need.
There are 2 questions:
Question 1) I want to be able to know the colour index of a pixel from a GIF format file.
With that I mean, as you know, a gif image file contains a colour palete, which is an array of length 256. Each array item from 0 to 255 contains a colour, and in GIF files, colours can be repeated in different positions. For example, I can have a grayscale palette, which will look something like this [#000000, #010101, #020202, ..., #FEFEFE, #FFFFFF], but in my case, all the colours are the same, lets say red:
[#FF0000,#FF0000,#FF000, ..., #FF0000]. That is perfectly valid in a GIF File, since each pixel is not tied to a colour, instead, it is tied to an index in the colour table. So even if the whole image is red (looks red), the actual bitmap data could be something like this:
(this code is conceptual, not actual C# code)
palete = redPalete; // [#ff0000,..., #ff0000] all red colours
pixelData = [[1,2,3,4,5,6,7,8,9,10 ... 256],
[1,2,3,4,5,6,7,8,9,10 ... 256],
...
[1,2,3,4,5,6,7,8,9,0 ... 256]]; //supose the pixel data is a matrix of colour indexes.
In this example, my image has all possible colours from the palette, but since the palette is all red, the image will look red.
Ok, that is ok, but now my problem, is...
How can I open that external GIF File, and iterate through pixels, retrieving its associated colour index in the palette table instead of the actual colour?? According to the previous example:
int colourIndex = miImage.getPixelColourIndex(0,0);
and i dont want to retrieve the value #ff0000, instead, i want to obtain the value 1.
and if i say:
int colourIndex = miImage.getPixelColourIndex(1,0); //colourIndex should be 2, since [[1,2,3 ....]
¿anyone got the idea of what i need? I need to know the colour index associated with a pixel, instead of the actual colour of that pixel (since several colour indexes can point to the same colour value, in this case red).
Question 2) Question 2 is exactly the opposite case. I want to write an indexed image (and then save it to GIF), according to the colour indexes values, instead of the colour.
That means, i want to do:
myImage.setPixel(0,0,1); //being setPixel(x, y, colourIndex);
i want that instead of saying the actual colour, which could look like:
myImage.setPixel(0,0,#ff0000); // I dont want this, i want to use the index value, not the colour, since my palette will contain all red values.
Please!!! I will sincerely appreciate help with this, I guess there is not a native function to do that, but probably there is a way around it, isnt it??
Thank you for reading and for your help in advance
Alvaro
|
|
|
|
|
Hey guys, how could it be? I dont even know PHP and I achieved to do what Im asking for in half an hour. How could it be that in .NET there is no way around it?
Any help?? (please!
|
|
|
|
|
1: When we use delegates?
2: Can I use delegates methods as normal methods? Please help me..
|
|
|
|
|
Use a delegate when:
1. An eventing design pattern is used.
2. It is desirable to encapsulate a static method.
3. The caller has no need access other properties, methods, or interfaces on the object implementing the method.
4. Easy composition is desired.
5. A class may need more than one implementation of the method and it will be decided at runtime as to which method to call.
Delegates are also used when call back functionality is to be implemented : Refer http://www.knowdotnet.com/articles/delegatesreplaceraiseevents.html[^]
Hope this helps.
All the best.
|
|
|
|
|
hello
my work internet computer has been blocked by fortiguard web filter and i can't access half of the websites
i don't have admin user and i cant download any progrem including programming compailers
can someone help me please?
thanks in advenced
|
|
|
|
|
yftah1989 wrote: can someone help me please?
Yes, your system administrators. Nobody here is going to help you to break the security settings laid down by your employer.
I must get a clever new signature for 2011.
|
|
|
|
|
party pooper
anyone else up to the challenge?
|
|
|
|
|
You have put the same question under PHP, ASP.NET and Javasript.
|
|
|
|
|
There's a reason you have security in place, and it would not be ethical to help you circumvent them. Part of the reason that the security will be in place is to prevent you from accessing content that wastes time that you should be working. How would you feel if you were the employer and your employees were trying to rip you off? You aren't being paid to surf twitter or facebook, so why should the company provide access to these. Another reason is to stop you downloading inappropriate content; how good would it look for the company if they were targetted for prosecution because you'd been pirating music on their PCs?
|
|
|
|
|
its just selfrighteous way to say that you dont know hwo to do it
|
|
|
|
|