|
Thank you Jason, I am looking into it.
|
|
|
|
|
Could you please give me any link to a real web page which currently uses Wep Parts, I know the technology but I would like to see it working in the practice.
Best Regarsrd
|
|
|
|
|
There are literally thousands of them, many you may not even be able to tell are using WebParts.
FJJCENTU wrote: I know the technology but I would like to see it working in the practice.
These statements are mutually exclusive. How can you claim to know the technology yet have not seen it in practice?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
My question has reference to that I have just done 3 Intranet projects, so I know how Web Parts work and how to work with them, but I never has seen other projects using Web Parts in Internet in order to get more utilizatión possibilities, so I simply try to see other Webs using Web Parts. I don´t think that it sounds so strange, at least for me.
|
|
|
|
|
I would like to display the result of an SQL query in a table: asp.net, please I need your advice, thank you
|
|
|
|
|
|
thanks, but I must respect what is asked
|
|
|
|
|
tek 2009 wrote: I must respect what is asked
What?
You do realize an ASP.NET GridView is rendered as a table right?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
and how can I do this?? what is required is to list the data in a control table: asp, but I failed to fill dynamically
|
|
|
|
|
Set the data you want to display as the Datasource for the gridview then use the Databind call. It's not overly complex.
Reference for you to read.
EDIT: Or use the Datasource control and bind to that but I don't like using that personally.
modified on Thursday, June 3, 2010 5:32 AM
|
|
|
|
|
tek 2009 wrote: please I need your advice
What advice do you need?
What have you tried?
1. Get data in a table or dataset from SQL Query...
2. Create a table, columns needs.
3. Traverse the dataset row by row and add it to the table!
Try it!
|
|
|
|
|
ok, thanks, i will be try it
|
|
|
|
|
Well done.
You've exhibited a staggering level of ineptitude and once again someone who is clearly incapable of searching for information themselves has got someone else to do the work for them.
If you can't even find info on this well covered subject may I suggest that you try an alternative career.
|
|
|
|
|
Hi,
I work on the code generation xml file I do not know how to modify it to populate the xml using a query sqlserver:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Text;
public partial class Etudiant11 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public class Etudiant
{
public int NumInscription { get; set; }
public string Nom { get; set; }
public string Prenom { get; set; }
public string CodeSexe { get; set; }
}
protected void Button1_Click(object sender, EventArgs e)
{
XmlSerializer serializer = new XmlSerializer(typeof(List<Etudiant>));
List<Etudiant> etudiants = new List<Etudiant>();
FileInfo fi = new FileInfo(@"C:\Temp\Etudiants.xml");
Etudiant etudiant = new Etudiant() { NumInscription = 123, Nom = "xxx", Prenom = "", CodeSexe = "M" };
etudiants.Add(etudiant);
etudiants.Add(etudiant);
etudiants.Add(etudiant);
using (MemoryStream mem = new MemoryStream())
{
serializer.Serialize(mem, etudiants);
using (FileStream fs = new FileStream(fi.FullName, FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
{
sw.Write(Encoding.UTF8.GetString(mem.ToArray()));
}
}
}
etudiant = null;
etudiants = null;
using (FileStream stream = fi.OpenRead())
{
XmlReader reader = XmlReader.Create(stream);
string str = reader.ReadInnerXml();
if (serializer.CanDeserialize(reader))
{
etudiants = (List<Etudiant>)serializer.Deserialize(reader);
}
}
foreach (Etudiant ee in etudiants)
{
Response .Write (string.Format("UPDATE ETUDIANT SET ETUDIANT_NOM = '{0}', ETUDIANT_PRENOM = '{1}', CODE SEXE = '{2}' WHERE NUM_INSCRIPTION = {3}", ee.Nom, ee.Prenom, ee.CodeSexe, ee.NumInscription));
}
}
} thanks
|
|
|
|
|
Do you mean you want to save an Etudiant to the DB or you want to populate an Etudiant from the DB?
|
|
|
|
|
You are trying to use an update statement on a geenric list of ETUDIANT objects. AFAIK, you cannot do this. Since your aim is to modify the XML file, you can make use of XmlDocument class.
|
|
|
|
|
Hi,
I try to create an xml file (from the database ) containing the student of a module, and then allow the teachers to download the file and convert it to Excel and insert markes for students then send the data to bda.
I do not know how do this, and if my way is right or not, I need your advice and help.
Thanks
|
|
|
|
|
Why are you creating XML?
Just create an Excel file from the database and let user download it. Once user is done with the changes, have a place where he can upload it and then save it back to the database.
You also get rid of this download and upload. Have a page with some GridView to display the student's records and have a set of controls where one can edit the data. Place a save button and make changes directly to the database instead of having files in between.
|
|
|
|
|
Hi,
I already tried the method of the gridview but I have hundreds of students in a module managing the grid is heavy.
To excel I try this code
cn.Open();
SqlDataAdapter da = new SqlDataAdapter(@"DECLARE @MATIERE nvarchar(max)
SELECT @MATIERE =
STUFF(
(
select distinct ',[' + LIBELLE_MATIERE + ']'
from MATIERE where CODE_MODULE =11
for xml path('')
),
1,1,'')
DECLARE @SQL nvarchar(max)
SELECT @SQL = N'
select
*
from (
SELECT ETUDIANT.NUM_INSCRIPTION, ETUDIANT.NOM_PRENOM_ETUDIANT_ARABE,EXAMEN.CODE,
EXAMEN.NOTE,
MATIERE.LIBELLE_MATIERE
FROM ETUDIANT INNER JOIN
EXAMEN ON ETUDIANT.NUM_INSCRIPTION = EXAMEN.NUM_INSCRIPTION INNER JOIN
CAPITALISE_MODULE ON
ETUDIANT.NUM_INSCRIPTION = CAPITALISE_MODULE.NUM_INSCRIPTION INNER JOIN
MATIERE ON EXAMEN.CODE_MATIERE = MATIERE.CODE_MATIERE INNER JOIN
MODULE ON CAPITALISE_MODULE.CODE_MODULE = MODULE.CODE_MODULE
AND MATIERE.CODE_MODULE = MODULE.CODE_MODULE
WHERE (CAPITALISE_MODULE.CODE_MODULE = 11) AND
(CAPITALISE_MODULE.CODE_TYPE_RELATION_MODULE = 1)
) Data
PIVOT (
SUM(NOTE)
FOR LIBELLE_MATIERE
IN (
' + @MATIERE + '
)
) PivotTable
'
exec sp_executesql @SQL
", cn);
DataTable dt = new DataTable();
da.Fill(dt);
cn.Close();
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
string sep = "";
foreach (DataColumn dc in dt.Columns)
{
Response.Write(sep + dc.ColumnName);
sep = "\t";
}
Response.Write("\n");
int i;
foreach (DataRow dr in dt.Rows)
{
sep = "";
for (i = 0; i < dt.Columns.Count; i++)
{
Response.Write(sep + dr[i].ToString());
sep = "\t";
}
Response.Write("\n");
}
}
}
excel file generated by this code gives me this:
Sudeni_id_____marks_matter1____marks_matte2
but how to allow just the marks between 0 and 20?
is a method to calculate the average module directl:ysum(marks_matter1*coefficient)/sum(coefficent)
I chose XML because it's easy to send to the database(I read that in an article )but i have a problem with generate it with sql,excel i dont have any edea if the data are not the same table.
Thanks
|
|
|
|
|
hy,
i have a requirement in which all the files present in the gadagrid has to be printed contiously without having to set the printer option again and agin...
i have used the following code in code behind
HtmlControl htmctl = (HtmlControl)this.FindControl("myFrame");
htmctl.Attributes["src"] = "../Files/11012009to021520101.txt";
and in java script
iframe.focus();
iframe.print();
I am unable to set default printer settings so that the printer dialog will not come out every time
Thanks & Regards,
Raghvendra Panda
modified on Wednesday, June 2, 2010 7:58 AM
|
|
|
|
|
but that shouldn't be down to you, it should be down to the end user. Someone might not want to print it to a default printer, they might want to send it do a pdf creator and email it on. It's a server trying to mess with client side functions silently and as such is unlikely to be allowed.AFAIK, javascript print commands will always do it too.
It's something akin to fax abuse where your code could automatically print out an ad when the user visits the page. I suggest you throw back this requirement because of these concerns.
|
|
|
|
|
Thanks For The Reply.But Thats What The requirement is..Soon As he clicks on print,all the files in the printer should get printed one by one.and the printer dialog should not come out again and again for every file.
|
|
|
|
|
Ok, you've cleared up the original problem a bit.
Can you not concatenate the files together for printing? There's no real way to do this from your app, it's seperate files so they'll each generate a dialog anyway.
|
|
|
|
|
Hi Guys,
I have no idea on developing Hosting Appliction like Godaddy.com.
Plz guide me if any one knows .with proper References adn sample code
Thanks
Srinivas
Dot net Programmer
|
|
|
|
|