|
I 'm from China,my English is not perfect.
my question is:
how to export data to popwerpoint using vs2005 with c#?
thanks
modified on Wednesday, March 19, 2008 10:34 PM
|
|
|
|
|
You cannot export it to powerpoint.
Supported export types are "PDF","Image","Excel".
If you want it in powerpoint save it to image, open a powerpoint presentation and den save the image onto the ppt.
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
Hi,
I hope someone can help with with my problem, i have searched the Internet for information but i couldnt find any examples neither the answear.
I use NHibernate and c# for my asp.net site.
I have the "classic" problem. I have a dropdownlist with "Regions" and another one "Municipalities".
When I choose an item in the ddlRegions the appropiate municipalites should be shown in ddlMunicipalties. I cant get this to work, do anyone have a code that does this and could share it with me?
I have tried for a few evenings but i cant get it to work.
Thanks
Thommie
|
|
|
|
|
Hi Thommie,
I think your looking for somting like this:
private void ddlRegions_SelectedIndexChanged(object sender, System.EventArgs e)
{
RetrieveMunicipalities( int.Parse( ddlRegions.SelectedValue ) );
}
private void RetrieveMunicipalities( int region)
{
ddlMunicipalities.DataSource = Retrieve_Municipalities( region);
ddlMunicipalities.DataBind();
}
Greetins,
Marco van der Linden
|
|
|
|
|
Hi Marco,
Whats "= Retrieve_Municipalities( region)"?
is that a method to bind the data from the database?
can you please show me?
Thanks for the answear
Thommie
|
|
|
|
|
Hi Thommie,
Its a method that retrieve data from the database.
public DataTable Retrieve_Municipalities( int region)
{
string connectieString = ConfigurationSettings.AppSettings["ConnectieString"];
SqlConnection connectie = new SqlConnection(connectieString);
SqlCommand commando = new SqlCommand("spRetrieveMunicipalities", connectie);
SqlDataAdapter adapter = new SqlDataAdapter(commando);
commando.CommandType = CommandType.StoredProcedure;
SqlParameter parameterHoofdgroep = new SqlParameter("@region", SqlDbType.Int);
parameterregion.Value = region;
commando.Parameters.Add(parameterregion);
DataTable regions= new DataTable();
adapter.Fill(regions);
connectie.Close();
return regions;
}
Greetings,
Marco
|
|
|
|
|
Hi,
My code looks like this and it doesnt work:
This is with NHibernate.
The error code : fetchQ.ParamName = "Region.Id";
The error text: NHibernate.QueryException: Type mismatch in NHibernate.Expression.EqExpression: Region.Id expected type System.Int32, actual type System.String
RegionId in database is int. And the hbm file is mapped Int32
private void BindMunicipalities(int regionId)<br />
{<br />
try<br />
{<br />
<br />
string municipalityHql = "SELECT count(municipality.Id) from Municipality municipality WHERE municipality.Region.Id = :regionId";<br />
<br />
IList<query> queries = new List<query>();<br />
Query q = new Query();<br />
q.ParamInt = regionId;<br />
q.ParamName = "regionId";<br />
queries.Add(q);<br />
<br />
int municipalityCount = DataManagement.CoreRepository.RunCountStatement(municipalityHql, queries);<br />
<br />
if (municipalityCount > 0)<br />
{<br />
<br />
IList<query> fetchQueries = new List<query>();<br />
Query fetchQ = new Query();<br />
fetchQ.ParamName = "region.Id";<br />
fetchQ.ParamInt = regionId;<br />
fetchQ.ParamEvaluationType = EvaluationType.Equals;<br />
fetchQ.ParamString = string.Empty;<br />
fetchQueries.Add(fetchQ);<br />
<br />
IList<municipality> municipalities = DataManagement.CoreRepository.GetAll<municipality>(fetchQueries, 0, 0, true, "Name");<br />
ddlMunicipality.DataValueField = "Id";<br />
ddlMunicipality.DataTextField = "Name";<br />
ddlMunicipality.DataSource = municipalities;<br />
ddlMunicipality.DataBind();<br />
}<br />
}<br />
<br />
catch (Exception ex)<br />
{<br />
logger.Error("Failed to load municipalities.", ex);<br />
this.lblError.Visible = true;<br />
}<br />
<br />
}<br />
<br />
<br />
protected void ddlRegions_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
<br />
this.BindMunicipalities(int.Parse(this.ddlRegions.SelectedValue));<br />
<br />
} <br />
</municipality></municipality></query></query></query></query>
modified on Thursday, March 20, 2008 5:16 PM
|
|
|
|
|
Is it possible to get the data out of a row before it is deleted in the gridview ?? I have implemented Gridview_RowDeleting event handler because I before this event fires before the actual delete occurs. I used the e.RowIndex where is e the GridviewDeleteEventArgs parameter of the function, and RowIndex is the row to be deleted.
however when i do a Gridview1.rows(e.rowindex).cells(1).text ... there is nothing in there. Yes there is data in the table. Same thing then i do cells(2) 0r cells(3). There are 19 columns in table.
Any suggestions on how i can get data pre - delete ?
|
|
|
|
|
Just in case anyone was wondering .... i solved my issue of getting the data out of a row about to be deleted.
Implement the RowDeleting event handler. Use the e.rowIndex where 'e' is the GridViewDeleteEventArgs parameter to the event handler, and 'rowindex' is the index of the row to be deleted. I passed e.rowindex to the gridiew.rows() collection with returns a GridViewRow object. My gridview uses templated fields.
Using that object, call findcontrol passing in the id of the control in the row that you want to find. In my case it was a Label control. Then you will be able to grad whatever data you need out of that control
Protected Sub GridView1_Rowdeleting(ByVal sender as Object,ByVal e as System.Web.UI.WebControls.GridviewDeleteEventArgs ) Handles GridView1.RowDeleting
Dim lblName as Label = CTYPE(Gridview1.Rows(e.RowIndex).FindControl("Label1"),Label)
Dim name as String = lblName.Text
End Sub
|
|
|
|
|
Hi I’m developing an internet ASP.NET application, which needs to interact with Microsoft Certification Authority Server, the
client (browser) will request a certificate to sign a file (word, pdf) later.
I'm really disoriented. Must I use CAPICOM? Signing in the server, and sending the certificate through an SSL connection? Is
there any class in the .Net Framework to interact with Certification Authority Service without CAPICOM or an external Api?
Where can i get a code example?
Regards
Sergio
|
|
|
|
|
Don't cross post. Read the forum rules.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hey all,
I've refactoring a site of mine from VB.Net to C# and using a more structured OO design. I have the main solution with the web project and then another project for the BLL and DAL. I'm creating a additional security class in the BLL and I want to be able to access the context of the user but I'm having a bit of a brain freeze. I know it's the HTTPContext.Context.User class but how do I inherit the this in the BLL function I've created? I've tried HTTPContext.Context but then User is not available.
Any help provided would be greatly appreciated!
Thanks,
Adrian
|
|
|
|
|
Does this work:
HttpContext.Current.User.Identity.Name
Alexei Rodriguez
|
|
|
|
|
No, I did think that would be how I could access it from the BLL but it's not available for some reason.
Thanks for the suggestion though. Any other ideas?
Thanks,
|
|
|
|
|
I found the problem, basically I'm using a different project for my Business Logic so needed to import the System.Web assembly into the class to access the Httpcontext class. It's actually bad practice to use the httpcontext I guess as it then requires a web front end but in my case I'm going to use it anyway.
Regards,
Adrian
|
|
|
|
|
I need to display four GridViews at once, but the data they contain differs in each grid by one parameter. It seems clumsy to add four identical SqlDataSource controls, so is there some way I can re-use one?
|
|
|
|
|
you can use stored procedure and bind one sqldatasource to that stored procedure. you can write down all the four queries with different parameters into your stored procedure using if loop instead of using four sqldatasources.
for that you have to add one more parameter for identify the query from the loop.
for example:
@count int,
@a varchar(50),
@b varchar(50),
@c varchar(50),
@d varchar(50)
if(@count=1)
begin
Query1 with parameter @a
end
if(@count=2)
begin
Query2 with parameter @b
end
if (@count=3)
begin
Query3 with parameter @c
end
if (@count=4)
begin
Query4 with parameter @d
end
|
|
|
|
|
I am developing a system using asp.net 2.0. I have the application on a production server. I have made changes to the app. in my development environment and the changes work fine but when I transfer the changed app to my production environment the changes will not work. It is like the old suystem has been cached. I am hosting production on IIS 5.0 W2K server. I have even deleted the old app of the server and rebooted the server but it appears to still pick up the old application with no changes.
Anyone any ideas how to fix this?
macca
|
|
|
|
|
You cannot be deploying it properly, if you rebooted the server, IIS is restarting and there's nowhere for it to cache, you're just not deploying it properly. You must be deleting/changing the wrong folder.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do you control the web-server? Could the site be being cached by a content acceleration server? If you re-name the folder on the website and can still hit the website then there is something wrong .
I would double check IIS to make sure it's pointing at the right location. If it is, then create a test HTML page in the root and try to access if from the site. If you can see it you know the website is working. Then update that file and see if you can see the updates. If you can then I agree, it must be something you're doing with the release of the new code.
Thanks,
Adrian
|
|
|
|
|
Hello,
I have a ASP.NET web form that I wanting to display data from a database. Right now I am using the gridview. Is this good to use for future maintenance? or is there a better method to use in order to work with database updates. Would it be better to add a 'table' to the web form and somehow connect it to the database? Do any stored procedures need to be created?
Non-sarcastic answers please Suggestions/ideas are very much appreciated. Thanks!
using C#
MS Server 2003
databasename: UserRequestDatabase
|
|
|
|
|
|
eyeseetee wrote: apply to session then put the session to a textbox or label and put where you want
What???
eyeseetee wrote: if you put the data into a datatable then you can display the datat however you want using c#
Or leave the data in a dataset, list, collection, or any number of containers. What a useless answer.
eyeseetee wrote: you dont have to display your data in a gridview
The only thing you should have said.
only two letters away from being an asset
|
|
|
|
|
|