|
Hello everyone:
I need to get some information about TableAdapters programatically. When I create a new instance of my DataSet like this:
<br />
DataSet ds = new DataSet();<br />
ds.ReadXmlSchema(MyDataSetFile);<br />
I can retrieve the information about DataTables but I dont see a way to retrieve information about TableAdapter. Any Ideas how to do it?
In an MSDN[^] article, it says to get to TableAdapter we will need a new instance of the TableAdapter and then it gives this example:
<br />
NorthwindDataSet northwindDataSet = new NorthwindDataSet();<br />
<br />
NorthwindDataSetTableAdapters.CustomersTableAdapter customersTableAdapter = <br />
new NorthwindDataSetTableAdapters.CustomersTableAdapter();<br />
<br />
customersTableAdapter.Fill(northwindDataSet.Customers);<br />
In my case I dont know which DataSet I will be working with untill runtime. Please help.
Thanks.
Regards,
Robert
|
|
|
|
|
TableAdapters are designer-generated components.
only two letters away from being an asset
|
|
|
|
|
I think, you need to creat typed DataSet to work with Table Adpater programmtically ........which will be generated code...
Sonny...
Sanjeev
|
|
|
|
|
Is php a server side script language?
|
|
|
|
|
That's true when using in Web Programming
|
|
|
|
|
Sir,
I am beginner in php.Not made a single project or a program.May I get some links to enrich my knowledge.
Thanks
|
|
|
|
|
You might want to post to the Web Development forum since this question has nothing to do with ASP.NET. You may also want to find out what the language is before asking questions.
only two letters away from being an asset
|
|
|
|
|
I had write a WebControl and its designer.The following is som of my code
<br />
[Designer("SM.WebControls.PagingControlDesigner"),<br />
ParseChildren(false)]<br />
public class PagingControl : System.Web.UI.WebControls.WebControl,INamingContainer<br />
{<br />
[Bindable(true),<br />
EditorAttribute(typeof(UrlEditor), typeof(UITypeEditor))] <br />
public string FirstButtonImg<br />
{<br />
get{return Convert.ToString(ViewState["FirstButtonImg"]);}<br />
set{ViewState["FirstButtonImg"] = value;}<br />
}<br />
<br />
protected PlaceHolder ParsedSubObjectContainer = new PlaceHolder();<br />
protected override void CreateChildControls()<br />
{<br />
Panel Panel1 = new Panel();<br />
Create some Controls and add to Panel1<br />
Controls.Add(Panel1);<br />
Controls.Add(ParsedSubObjectContainer);<br />
}<br />
protected override void AddParsedSubObject(Object obj)<br />
{<br />
ParsedSubObjectContainer.Controls.Add((Control)obj);<br />
}<br />
<br />
internal string GetDesignTimeHtml()<br />
{<br />
EnsureChildControls();<br />
StringWriter sw = new StringWriter();<br />
HtmlTextWriter writer = new HtmlTextWriter(sw);<br />
this.RenderControl(writer);<br />
return sw.ToString();<br />
}<br />
...<br />
}<br />
public class PagingControlDesigner : ControlDesigner<br />
{<br />
public override bool DesignTimeHtmlRequiresLoadComplete<br />
{<br />
get{ return true;}<br />
}<br />
<br />
private PagingControl PagingControlInstance;<br />
<br />
public override void Initialize(System.ComponentModel.IComponent component)<br />
{<br />
this.PagingControlInstance = (PagingControl) component;<br />
base.Initialize (component);<br />
}<br />
<br />
public override string GetDesignTimeHtml() <br />
{<br />
return PagingControlInstance.GetDesignTimeHtml();<br />
}<br />
...<br />
}<br />
I faced two problems when I writing this WebControl.
The First is when I try to bind the FirstButtonImg property in a web form, the expression is not evaluated.It simple pass the '<%= Expression %>' string to the property
<br />
<SM:PagingControl id="PagingControl1" runat="server" <br />
FirstButtonImg='<%= Expression %>'<br />
><br />
I do call PagingControl1.DataBind() in my WebForm's code.
The second, when I am designing a WebFrom:
<br />
<SM:PagingControl id="PagingControl1" runat="server"><br />
<asp:DataGrid id="DataGrid1" runat="server"><br />
</asp:DataGrid><br />
</SM:PagingControl><br />
Only the Panel(Panel1) is displayed in the designer.But the ParsedSubObjects(here is DataGrid1) is not displayed.How can I get the ParsedSubObjects'(here is DataGrid's) DesignTimeHTML to display it in the designer.
Can any one help me? Any idea will be appropriate.
|
|
|
|
|
How can I keep the page focused on a specific control after I've performed a postback?
I have a datagrid located on the bottom of my page. Each row contains a ButtonColumn, which when clicked, changes an image located alongside the grid.
My problem however is every time the user clicks a button in the grid, a Postback is performed and after the page refreshes, it returns the user back up to the top of the page (which can be quite annoying when you're performing clicks on 30-40 different rows).
So how can I prevent the page from returning back to the top every time?
Thanks.
-Goalie35
|
|
|
|
|
Add this function into your global module:
Public Function SetFocus(ByVal FocusControl As Control) As String<br />
'Setting focus to supplied control<br />
Dim Script As New System.Text.StringBuilder<br />
Dim ClientID As String = FocusControl.ClientID<br />
<br />
'Building java script<br />
With Script<br />
.Append("<script language='javascript'>")<br />
.Append("document.getElementById('")<br />
.Append(ClientID)<br />
.Append("').focus();")<br />
.Append("</script>")<br />
End With<br />
<br />
Return Script.ToString()<br />
End Function
Call the function above from your from passing control to be focused:
RegisterStartupScript("setFocus", Utilities.SetFocus(TextBox1))
==postmaster
www.programmingknowledge.com
|
|
|
|
|
use the MaintainScrollPositionOnPostback page directive
only two letters away from being an asset
|
|
|
|
|
Try this
Add this function into your global module:
Public Function SetFocus(ByVal FocusControl As Control) As String
'Setting focus to supplied control
Dim Script As New System.Text.StringBuilder
Dim ClientID As String = FocusControl.ClientID
'Building java script
With Script
.Append("")
.Append("document.getElementById('")
.Append(ClientID)
.Append("').Select();")
.Append("")
End With
Return Script.ToString()
End Function
Call the function above from your from passing control to be focused:
RegisterStartupScript("setFocus", Utilities.SetFocus(TextBox1))
|
|
|
|
|
This appears to be exactly, verbatim what postmaster@programmingknowledge.com posted about 2 hours before you.
Now the question is did you both copy it from the same source, did you copy from his post, or possibly is it from The Osmosian Order Handbook?
only two letters away from being an asset
|
|
|
|
|
The RowCommand is raised when a user presses a button on a GridView. Could someone please tell me how I can programmatically raise the RowCommand of within the event handler of another instance of an object? Paste some simple code if you can.
|
|
|
|
|
|
You can call any event just like you would any other method...you just need the right parms. The RowCommand event handler looks like this:
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
End Sub
So you have to send it an Object and a System.Web.UI.WebControls.GridViewCommandEventArgs
I don't know what all of the event arguments are, but you can use intellisense to help you figure out what you need...maybe this will help you get started:
Dim myOrginalArgs As New System.Web.UI.WebControls.CommandEventArgs(myCommandName, myArgument)
Dim myGridViewCommandEventArgs As New System.Web.UI.WebControls.GridViewCommandEventArgs(myGridViewRow, myOrginalArgs)
GridView1_RowCommand(myObject, myGridViewCommandEventArgs)
|
|
|
|
|
Hi,
In my C# Globals.cs class if the following varianble declaration and a property to retrieve this value:
private const String COMPANY_LONG_NAME = "J&D Ship Services";
And by using Globals.CompanyLongName I can print this "J&D Ship Services" in the web page. So after creating the e-mail link, it looks like this:
<a href="mailto:me@yahoo.com?Subject=Enquiry from J&D Ship Services">me@yahoo.com</a>
When I click on this link everything works well, except for the subject heading, it gets cut off after Enquiry from J.
How do I get this to work properly?
Regards
ma se
|
|
|
|
|
You could try and html encode the string.
|
|
|
|
|
Hello,
I created an Asp.Net 2.0 Access Data Source.
Is it possible to loop the loaded records and access each record field value?
Thanks,
Miguel
|
|
|
|
|
Plz don't post same question multiple times.
|
|
|
|
|
Hello,
I am working in ASP.NET 1.1
I am loading an image in a page on a button click.
Each time I click on the button the image is gettign loaded but until i refresh the page the image is not getting loaded into the page. How can i solve this problem.
|
|
|
|
|
Don't repost the same question.
With Regards
Satips
|
|
|
|
|
Hello Satips,
It was not purposly posted twice. DUe to browser problem it got posted twice. Take it easy
|
|
|
|
|
|
Sounds like you have the order of your code in page load and the button click wrong. Page load events will get called before the button click event.
|
|
|
|