473,508 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ObjectDataSource completely in code behind

I'm dynamically creating PDFs and trying to create an objectdatasource
completely in the code behind, but I can't figure out how to call the
selected event. Here's what I have so far...

string App1ID = 1234;
ObjectDataSource Appendix1 = new ObjectDataSource();
Appendix1.TypeName = "Appendix1BLL";
Appendix1.SelectMethod = "GetAppendix1ByAppendix1ID";
Appendix1.SelectParameters.Add("Appendix1ID", App1ID);
Appendix1.Select();
--Here's where I need to call the Selected event--

Thanks in advance for your help.

-Sean

Aug 10 '07 #1
4 7062
Hi,

"Sean" <se*******@gmail.comwrote in message
news:11*********************@e9g2000prf.googlegrou ps.com...
I'm dynamically creating PDFs and trying to create an objectdatasource
completely in the code behind, but I can't figure out how to call the
selected event. Here's what I have so far...

string App1ID = 1234;
ObjectDataSource Appendix1 = new ObjectDataSource();
Appendix1.TypeName = "Appendix1BLL";
Appendix1.SelectMethod = "GetAppendix1ByAppendix1ID";
Appendix1.SelectParameters.Add("Appendix1ID", App1ID);
Appendix1.Select();
--Here's where I need to call the Selected event--
We need more info, what has the PDF generation has to do with databinding?
Aug 10 '07 #2
Well, nothing really. The databinding is used to pull information
from a database to use in the PDF. I can't put the objectdatasource
on the page because it screws up the PDF creation, so I need to do it
all in the code behind.

-Sean

On Aug 10, 10:00 am, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.comwrote:
Hi,

"Sean" <sean.s...@gmail.comwrote in message

news:11*********************@e9g2000prf.googlegrou ps.com...
I'm dynamically creating PDFs and trying to create an objectdatasource
completely in the code behind, but I can't figure out how to call the
selected event. Here's what I have so far...
string App1ID = 1234;
ObjectDataSource Appendix1 = new ObjectDataSource();
Appendix1.TypeName = "Appendix1BLL";
Appendix1.SelectMethod = "GetAppendix1ByAppendix1ID";
Appendix1.SelectParameters.Add("Appendix1ID", App1ID);
Appendix1.Select();
--Here's where I need to call the Selected event--

We need more info, what has the PDF generation has to do with databinding?

Aug 10 '07 #3
Sometimes pausing to read intellisense is a good idea...

I came up with the following solution thanks to Visual Studio's magic
tab completion...

protected void Page_Load(object sender, EventArgs e)
{
...
Appendix1.Selected += new
ObjectDataSourceStatusEventHandler(Appendix1_Selec ted);
}
void Appendix1_Selected(object sender,
ObjectDataSourceStatusEventArgs e)
{
...
}

-Sean

On Aug 10, 10:06 am, Sean <sean.s...@gmail.comwrote:
Well, nothing really. The databinding is used to pull information
from a database to use in the PDF. I can't put the objectdatasource
on the page because it screws up the PDF creation, so I need to do it
all in the code behind.

-Sean

On Aug 10, 10:00 am, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA

laceupsolutions.comwrote:
Hi,
"Sean" <sean.s...@gmail.comwrote in message
news:11*********************@e9g2000prf.googlegrou ps.com...
I'm dynamically creating PDFs and trying to create an objectdatasource
completely in the code behind, but I can't figure out how to call the
selected event. Here's what I have so far...
string App1ID = 1234;
ObjectDataSource Appendix1 = new ObjectDataSource();
Appendix1.TypeName = "Appendix1BLL";
Appendix1.SelectMethod = "GetAppendix1ByAppendix1ID";
Appendix1.SelectParameters.Add("Appendix1ID", App1ID);
Appendix1.Select();
--Here's where I need to call the Selected event--
We need more info, what has the PDF generation has to do with databinding?

Aug 10 '07 #4
HI ,
I still do not see the relationship between them, but if it solved your
problem then congratz :)
"Sean" <se*******@gmail.comwrote in message
news:11**********************@x35g2000prf.googlegr oups.com...
Sometimes pausing to read intellisense is a good idea...

I came up with the following solution thanks to Visual Studio's magic
tab completion...

protected void Page_Load(object sender, EventArgs e)
{
...
Appendix1.Selected += new
ObjectDataSourceStatusEventHandler(Appendix1_Selec ted);
}
void Appendix1_Selected(object sender,
ObjectDataSourceStatusEventArgs e)
{
...
}

-Sean

On Aug 10, 10:06 am, Sean <sean.s...@gmail.comwrote:
>Well, nothing really. The databinding is used to pull information
from a database to use in the PDF. I can't put the objectdatasource
on the page because it screws up the PDF creation, so I need to do it
all in the code behind.

-Sean

On Aug 10, 10:00 am, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA

laceupsolutions.comwrote:
Hi,
"Sean" <sean.s...@gmail.comwrote in message
>news:11*********************@e9g2000prf.googlegro ups.com...
I'm dynamically creating PDFs and trying to create an
objectdatasource
completely in the code behind, but I can't figure out how to call the
selected event. Here's what I have so far...
string App1ID = 1234;
ObjectDataSource Appendix1 = new ObjectDataSource();
Appendix1.TypeName = "Appendix1BLL";
Appendix1.SelectMethod = "GetAppendix1ByAppendix1ID";
Appendix1.SelectParameters.Add("Appendix1ID", App1ID);
Appendix1.Select();
--Here's where I need to call the Selected event--
We need more info, what has the PDF generation has to do with
databinding?


Aug 10 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1479
by: Eiriken | last post by:
Hello everyone, I am using ASP.NET 2 and trying to bind a objectdatasource to a gridview. By doing this the most common way by adding an objectdatasource to the page and by using the wizard to...
1
5542
by: ThomasNexoe | last post by:
Hi there, I quite new to posting in this forum. I have a problem which I truly hope someone can help me out. I have a master/detail page - with a gridview displaying company names, and a...
7
3430
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
0
1007
by: Raymond Du | last post by:
Hi, This is the first time I use ObjectDatasource, I have the following declaration in aspx file: <asp:ObjectDataSource ID="odsSubmissions" SelectMethod="ListBandContestantPaged"...
4
4677
by: TarTar | last post by:
Hello, I have already posted this problem, but I have not received any response yet. I will try to describe it again. We have a list control (e.g. DataList) and an ObjectDataSource on an...
1
991
by: Prasanta | last post by:
Hello, I have a project less solution asp.net 2.0 with c#. I have a method in page code behind which returns a datatable, that method I want to assign in the objectdatasource select method, but...
2
1866
by: =?Utf-8?B?U0FM?= | last post by:
Does anyone know how to re-use the asp:ObjectDataSource control? What I want to do is add ONE asp:ObjectDataSource control to my Web form, then BIND it to MULTIPLE DropDownList boxes in the Code...
0
1131
by: =?Utf-8?B?U0FM?= | last post by:
Does anyone know how to re-use the asp:ObjectDataSource control? What I want to do is add ONE asp:ObjectDataSource control to my Web form, then BIND it to MULTIPLE DropDownList boxes in the Code...
3
11153
by: btreddy | last post by:
Hii all, I've a problem regarding passing select parameters to objectdatasource from code behind. i would like to pass the select parameters to a objectdatasource ..not in the selecting or...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.