Saturday, March 31, 2012
TableAdapter: How do I create one which inserts values from a form into two tables?
to provide information regarding themselves and also the booking
detail. I want to send the data into two tables. One, the personalinfo
table and another bookinginfo. The bookinginfo, also has a column for
personalID which links it to the personalInfo table. How can I do this
with eiter an ASP button control use a table adapter to do it.
Sorry if this sounds trivial but I am really new to ASP and SQL.
RegardsYou'd need to simply write the data out to the table. Have a look at the
connection objects in .NET there is actually a lot of code that already does
what you want posted all over the web.
Regards,
Alvin Bruney
---
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
"Fendi Baba" <effendi@.epitome.com.sg> wrote in message
news:1171175411.943113.134530@.h3g2000cwc.googlegroups.com...
>I am creating a simple booking system. The system requires the users
> to provide information regarding themselves and also the booking
> detail. I want to send the data into two tables. One, the personalinfo
> table and another bookinginfo. The bookinginfo, also has a column for
> personalID which links it to the personalInfo table. How can I do this
> with eiter an ASP button control use a table adapter to do it.
> Sorry if this sounds trivial but I am really new to ASP and SQL.
> Regards
>
TableAdapter: How do I create one which inserts values from a form into two tables?
to provide information regarding themselves and also the booking
detail. I want to send the data into two tables. One, the personalinfo
table and another bookinginfo. The bookinginfo, also has a column for
personalID which links it to the personalInfo table. How can I do this
with eiter an ASP button control use a table adapter to do it.
Sorry if this sounds trivial but I am really new to ASP and SQL.
RegardsYou'd need to simply write the data out to the table. Have a look at the
connection objects in .NET there is actually a lot of code that already does
what you want posted all over the web.
--
Regards,
Alvin Bruney
----------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
"Fendi Baba" <effendi@.epitome.com.sgwrote in message
news:1171175411.943113.134530@.h3g2000cwc.googlegro ups.com...
Quote:
Originally Posted by
>I am creating a simple booking system. The system requires the users
to provide information regarding themselves and also the booking
detail. I want to send the data into two tables. One, the personalinfo
table and another bookinginfo. The bookinginfo, also has a column for
personalID which links it to the personalInfo table. How can I do this
with eiter an ASP button control use a table adapter to do it.
>
Sorry if this sounds trivial but I am really new to ASP and SQL.
>
Regards
>
Monday, March 26, 2012
tabs
r
navigation. How can i create a "tab" look navigation system for my portal?Mike,
Funny you ask...I am working on a similar project. Follow my thread
directly below yours at
http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
"Mike" wrote:
> I'm creating a "portal" type web app and i want to use a "tab" appearance
for
> navigation. How can i create a "tab" look navigation system for my portal
?
>
I too am writing an application with tabs. Wrote mine "by hand" - some HTML
in a user control, and pass a variable to the UC with the current tab. Bit
basic I know but it does the job :o)
"Chris Fink" wrote:
> Mike,
> Funny you ask...I am working on a similar project. Follow my thread
> directly below yours at
> http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
> "Mike" wrote:
>
One way would be to investigate a prebuilt tab control to see if it
offers the functionality you need (and if it includes source, you can
make modifications).
One place to look would be the IE WebControl gallery on asp.net:
http://www.asp.net/ControlGallery/d...y=38&tabindex=2
HTH,
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 15 Oct 2004 07:03:33 -0700, "Chris Fink"
<ChrisFink@.discussions.microsoft.com> wrote:
>Mike,
>Funny you ask...I am working on a similar project. Follow my thread
>directly below yours at
>http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
>"Mike" wrote:
>
Not exactly tabs per se but I accomplished this by using buttons (!).
I put them all right next to each other in a user control, added a
method that changes the active tab and then used CSS to differentiate
(I basically made the button's bottom border go away and made its
background color the same as the page's and bolded the text so it looks
pretty much like a tab, even though it's just a button). The non-active
'tabs' have a totally different background and have all their borders.
It works, even though it may not be perfect.
James
Mike wrote:
> I'm creating a "portal" type web app and i want to use a "tab"
> appearance for navigation. How can i create a "tab" look navigation
> system for my portal?
Hmm.. never gave that one a thought! Guess that's my ASP roots coming throug
h
:)
Another way of doing the tabs might be to use the Tab control that comes
with the IEControls thingy from ASP.NET - don't know if that's the link that
Steve gave - haven't checked.
"James Thomas" wrote:
> Not exactly tabs per se but I accomplished this by using buttons (!).
> I put them all right next to each other in a user control, added a
> method that changes the active tab and then used CSS to differentiate
> (I basically made the button's bottom border go away and made its
> background color the same as the page's and bolded the text so it looks
> pretty much like a tab, even though it's just a button). The non-active
> 'tabs' have a totally different background and have all their borders.
> It works, even though it may not be perfect.
> James
> Mike wrote:
>
>
The only problem with the IE Tab control is that it's not cross-browser
compatible - of course, if that's not what you're striving for, then it
doesn't matter. :)
James
Dan Nash wrote:
> Hmm.. never gave that one a thought! Guess that's my ASP roots coming
> through :)
> Another way of doing the tabs might be to use the Tab control that
> comes with the IEControls thingy from ASP.NET - don't know if that's
> the link that Steve gave - haven't checked.
>
> "James Thomas" wrote:
>
tabs
navigation. How can i create a "tab" look navigation system for my portal?Mike,
Funny you ask...I am working on a similar project. Follow my thread
directly below yours at
http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
"Mike" wrote:
> I'm creating a "portal" type web app and i want to use a "tab" appearance for
> navigation. How can i create a "tab" look navigation system for my portal?
>
I too am writing an application with tabs. Wrote mine "by hand" - some HTML
in a user control, and pass a variable to the UC with the current tab. Bit
basic I know but it does the job :o)
"Chris Fink" wrote:
> Mike,
> Funny you ask...I am working on a similar project. Follow my thread
> directly below yours at
> http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
> "Mike" wrote:
> > I'm creating a "portal" type web app and i want to use a "tab" appearance for
> > navigation. How can i create a "tab" look navigation system for my portal?
One way would be to investigate a prebuilt tab control to see if it
offers the functionality you need (and if it includes source, you can
make modifications).
One place to look would be the IE WebControl gallery on asp.net:
http://www.asp.net/ControlGallery/d...y=38&tabindex=2
HTH,
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 15 Oct 2004 07:03:33 -0700, "Chris Fink"
<ChrisFink@.discussions.microsoft.com> wrote:
>Mike,
>Funny you ask...I am working on a similar project. Follow my thread
>directly below yours at
>http://msdn.microsoft.com/newsgroup...t&lang=en&cr=US
>"Mike" wrote:
>> I'm creating a "portal" type web app and i want to use a "tab" appearance for
>> navigation. How can i create a "tab" look navigation system for my portal?
>>
>
Not exactly tabs per se but I accomplished this by using buttons (!).
I put them all right next to each other in a user control, added a
method that changes the active tab and then used CSS to differentiate
(I basically made the button's bottom border go away and made its
background color the same as the page's and bolded the text so it looks
pretty much like a tab, even though it's just a button). The non-active
'tabs' have a totally different background and have all their borders.
It works, even though it may not be perfect.
James
Mike wrote:
> I'm creating a "portal" type web app and i want to use a "tab"
> appearance for navigation. How can i create a "tab" look navigation
> system for my portal?
Hmm.. never gave that one a thought! Guess that's my ASP roots coming through
:)
Another way of doing the tabs might be to use the Tab control that comes
with the IEControls thingy from ASP.NET - don't know if that's the link that
Steve gave - haven't checked.
"James Thomas" wrote:
> Not exactly tabs per se but I accomplished this by using buttons (!).
> I put them all right next to each other in a user control, added a
> method that changes the active tab and then used CSS to differentiate
> (I basically made the button's bottom border go away and made its
> background color the same as the page's and bolded the text so it looks
> pretty much like a tab, even though it's just a button). The non-active
> 'tabs' have a totally different background and have all their borders.
> It works, even though it may not be perfect.
> James
> Mike wrote:
> > I'm creating a "portal" type web app and i want to use a "tab"
> > appearance for navigation. How can i create a "tab" look navigation
> > system for my portal?
>
The only problem with the IE Tab control is that it's not cross-browser
compatible - of course, if that's not what you're striving for, then it
doesn't matter. :)
James
Dan Nash wrote:
> Hmm.. never gave that one a thought! Guess that's my ASP roots coming
> through :)
> Another way of doing the tabs might be to use the Tab control that
> comes with the IEControls thingy from ASP.NET - don't know if that's
> the link that Steve gave - haven't checked.
>
> "James Thomas" wrote:
> > Not exactly tabs per se but I accomplished this by using buttons
> > (!).
> > I put them all right next to each other in a user control, added a
> > method that changes the active tab and then used CSS to
> > differentiate (I basically made the button's bottom border go away
> > and made its background color the same as the page's and bolded the
> > text so it looks pretty much like a tab, even though it's just a
> > button). The non-active 'tabs' have a totally different background
> > and have all their borders.
> > It works, even though it may not be perfect.
> > James
> > Mike wrote:
> > > I'm creating a "portal" type web app and i want to use a "tab"
> > > appearance for navigation. How can i create a "tab" look
> > > navigation system for my portal?
Saturday, March 24, 2012
TagPrefix is not recognized
I am creating a ASP.net 2.0 webpart for use in an aspx just for
learning purpose.
My webpart code is very simple :
Now when I use this webpart DLL as a reference in website project and
include this line
<%@dotnet.itags.org. Register TagPrefix="custom" Namespace="aspwebpart" %>
The custom keywork is not usable inside the aspx page.
These lines throw the error that FeaturePart is not recognized
<WebPartsTemplate>
<custom:FeaturePart ID="my" Runat="Server" />
</WebPartsTemplate>
Any Ideas??
================================================== =========
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
namespace aspwebpart
{
public class FeaturePart:WebPart
{
const string str =
"server=10.111.121.24;Trusted_Connection=true;Datab ase=NorthWind";
const string query = "Select * from products";
public FeaturePart()
{
this.Title = "Feature Part";
}
protected override void RenderContents(HtmlTextWriter writer)
{
DataTable pt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(query, str);
da.Fill(pt);
Random rnd = new Random();
DataRow row = pt.Rows[rnd.Next(pt.Rows.Count)];
writer.Write((string)row["ProductName"]);
writer.Write(string.Format("-{0:c}", row["UnitPrice"]));
base.RenderContents(writer);
}
}
}
Regards
MadhurMadhur,
Check out my post "Error creating control..Server tag error" from earlier in
the day. I had this error with a custom control. Don't know if the same
applies to webparts but you may need to add the "assembly=" attribute. See
my sample code and resolution in the posts. Dave
"ahuja.madhur@.gmail.com" wrote:
Quote:
Originally Posted by
Hello
>
I am creating a ASP.net 2.0 webpart for use in an aspx just for
learning purpose.
My webpart code is very simple :
>
Now when I use this webpart DLL as a reference in website project and
include this line
>
<%@. Register TagPrefix="custom" Namespace="aspwebpart" %>
>
The custom keywork is not usable inside the aspx page.
These lines throw the error that FeaturePart is not recognized
<WebPartsTemplate>
>
<custom:FeaturePart ID="my" Runat="Server" />
</WebPartsTemplate>
>
Any Ideas??
>
================================================== =========
>
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
>
namespace aspwebpart
{
>
public class FeaturePart:WebPart
{
const string str =
"server=10.111.121.24;Trusted_Connection=true;Datab ase=NorthWind";
const string query = "Select * from products";
>
public FeaturePart()
{
this.Title = "Feature Part";
}
>
protected override void RenderContents(HtmlTextWriter writer)
{
>
DataTable pt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(query, str);
da.Fill(pt);
Random rnd = new Random();
DataRow row = pt.Rows[rnd.Next(pt.Rows.Count)];
>
writer.Write((string)row["ProductName"]);
writer.Write(string.Format("-{0:c}", row["UnitPrice"]));
>
base.RenderContents(writer);
}
>
}
}
>
Regards
>
Madhur
>
>
Hi Dave
Gr8 !!! That did the trick. Thanks very much
Clear me one thing, what does Assembly attribute refers to?
Does it refer dll file name or Assembly is an attribute stored inside
..NET metadata.
I am asking it because when I appended .dll in front of it, it again
gave the same error.
Madhur
Dave wrote:
Quote:
Originally Posted by
Madhur,
>
Check out my post "Error creating control..Server tag error" from earlier in
the day. I had this error with a custom control. Don't know if the same
applies to webparts but you may need to add the "assembly=" attribute. See
my sample code and resolution in the posts. Dave
>
"ahuja.madhur@.gmail.com" wrote:
>
Quote:
Originally Posted by
Hello
I am creating a ASP.net 2.0 webpart for use in an aspx just for
learning purpose.
My webpart code is very simple :
Now when I use this webpart DLL as a reference in website project and
include this line
<%@. Register TagPrefix="custom" Namespace="aspwebpart" %>
The custom keywork is not usable inside the aspx page.
These lines throw the error that FeaturePart is not recognized
<WebPartsTemplate>
<custom:FeaturePart ID="my" Runat="Server" />
</WebPartsTemplate>
Any Ideas??
================================================== =========
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
namespace aspwebpart
{
public class FeaturePart:WebPart
{
const string str =
"server=10.111.121.24;Trusted_Connection=true;Datab ase=NorthWind";
const string query = "Select * from products";
public FeaturePart()
{
this.Title = "Feature Part";
}
protected override void RenderContents(HtmlTextWriter writer)
{
DataTable pt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(query, str);
da.Fill(pt);
Random rnd = new Random();
DataRow row = pt.Rows[rnd.Next(pt.Rows.Count)];
writer.Write((string)row["ProductName"]);
writer.Write(string.Format("-{0:c}", row["UnitPrice"]));
base.RenderContents(writer);
}
}
}
Regards
Madhur
Madhur,
The assembly name refers to the project that contains my custom controls.
In my case my project name was CustomControls, so when I compile it becomes
CustomControls.dll. The assembly attribute must then match the name of the
dll..."Assembly="CustomControls" without the .dll extension though..go figure.
"ahuja.madhur@.gmail.com" wrote:
Quote:
Originally Posted by
Hi Dave
>
Gr8 !!! That did the trick. Thanks very much
Clear me one thing, what does Assembly attribute refers to?
Does it refer dll file name or Assembly is an attribute stored inside
..NET metadata.
>
I am asking it because when I appended .dll in front of it, it again
gave the same error.
>
Madhur
>
>
Dave wrote:
>
Quote:
Originally Posted by
Madhur,
Check out my post "Error creating control..Server tag error" from earlier in
the day. I had this error with a custom control. Don't know if the same
applies to webparts but you may need to add the "assembly=" attribute. See
my sample code and resolution in the posts. Dave
"ahuja.madhur@.gmail.com" wrote:
Quote:
Originally Posted by
Hello
>
I am creating a ASP.net 2.0 webpart for use in an aspx just for
learning purpose.
My webpart code is very simple :
>
Now when I use this webpart DLL as a reference in website project and
include this line
>
<%@. Register TagPrefix="custom" Namespace="aspwebpart" %>
>
The custom keywork is not usable inside the aspx page.
These lines throw the error that FeaturePart is not recognized
<WebPartsTemplate>
>
<custom:FeaturePart ID="my" Runat="Server" />
</WebPartsTemplate>
>
Any Ideas??
>
================================================== =========
>
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
>
namespace aspwebpart
{
>
public class FeaturePart:WebPart
{
const string str =
"server=10.111.121.24;Trusted_Connection=true;Datab ase=NorthWind";
const string query = "Select * from products";
>
public FeaturePart()
{
this.Title = "Feature Part";
}
>
protected override void RenderContents(HtmlTextWriter writer)
{
>
DataTable pt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(query, str);
da.Fill(pt);
Random rnd = new Random();
DataRow row = pt.Rows[rnd.Next(pt.Rows.Count)];
>
writer.Write((string)row["ProductName"]);
writer.Write(string.Format("-{0:c}", row["UnitPrice"]));
>
base.RenderContents(writer);
}
>
}
}
>
Regards
>
Madhur
>
>
>
>
Tuesday, March 13, 2012
targeting a response.write to a section of a web page
response.Write("<a href='www.yadda.com >Hello</a><br />")
multiple times, creating hyperlinks like so:
Hello
Hello
Hello
Hello
Hello
Hello
Anyway, I want the values above to be put in a specific location of my
web page (inside a table cell), instead of the top, which pushes all my
content down.
Basically, I am using xquery in a search field to go through an xml
document that contains my web site navigation info, returning a url
attribute. I have the url string from the xml doc converted to a
hyperlink using the code above.
Any suggestions are appreciated.Can you drop label members where you want the links and just add this
code to your method?
label.Text = "<a href='www.yadda.com'>Hello</a>";
Hope this helps.
I ended up hiding a table within the table and appended rows and cells
with the urls.
for each book in nodeList
Dim tempRow As New TableRow()
Dim tempCell As New TableCell()
tempCell.Text = "<a class='HoverStyle' href="http://links.10026.com/?link= &
book.Attributes("url").Value & " target='_blank' a>" &
book.Attributes("title").Value & "</a>"
tempRow.Cells.Add(tempCell)
tblSearchResults.Rows.Add(tempRow)
next
thanks.
simple solution...
1) Make the table Cell Server control . <td id="cell1" runat="server"
2) keep adding all links to the cell
cell1.InnerHtml += "<a href='www.yadda.com >Hello</a><br />"
better solution.. this way u will have better control on the layout of
links
1) Make the table a Server control . <table id="table1" runat="server"
2) keep adding rows HtmlTableRow and HtmlTableCell objects to the table
for each link
targeting a response.write to a section of a web page
response.Write("<a href='www.yadda.com >Hello</a><br />")
multiple times, creating hyperlinks like so:
Hello
Hello
Hello
Hello
Hello
Hello
Anyway, I want the values above to be put in a specific location of my
web page (inside a table cell), instead of the top, which pushes all my
content down.
Basically, I am using xquery in a search field to go through an xml
document that contains my web site navigation info, returning a url
attribute. I have the url string from the xml doc converted to a
hyperlink using the code above.
Any suggestions are appreciated.I ended up hiding a table within the table and appended rows and cells
with the urls.
for each book in nodeList
Dim tempRow As New TableRow()
Dim tempCell As New TableCell()
tempCell.Text = "<a class='HoverStyle' href="http://links.10026.com/?link= &
book.Attributes("url").Value & " target='_blank' a>" &
book.Attributes("title").Value & "</a>"
tempRow.Cells.Add(tempCell)
tblSearchResults.Rows.Add(tempRow)
next
thanks.
simple solution...
1) Make the table Cell Server control . <td id="cell1" runat="server"
2) keep adding all links to the cell
cell1.InnerHtml += "<a href='www.yadda.com >Hello</a><br />"
better solution.. this way u will have better control on the layout of
links
1) Make the table a Server control . <table id="table1" runat="server"
2) keep adding rows HtmlTableRow and HtmlTableCell objects to the table
for each link
targetSchema - Netscape Buttons wont work
The targetSchema is Navigator 4.0.
I have created a button and placed some code behind, something I have done a thousand times.
Why then won't the code work in this targetSchema when the button is clicked?
Thanks,
Zathnevermind, I had some text boxes on a control on that form and the button was trying to validate them... DOH
TargetSchema meta tag and TargetSchema attribute
If I'm building an application that I want to be browser-independant,should I eliminate this meta tag and attribute, should I add additionalmeta tags and attributes, or will any of these actions make adifference?
Thanks in advance for your help!
Hi there,
Just add following in your web.config file.. This should do the job for you.
<browserCaps>
tagwriter=System.Web.UI.HtmlTextWriter
</browserCaps>
Regards,
Thanks a lot for your reply ... I'm going to read up on browerCaps.
However, I'd still like specific information concerning my questions about the TargetSchema metatag and @.Control attribute. I'd appreciate any help.
Thanks again.