|
Hi, PC Plus Magazine (recent issue, Code it section) states that ASP.NET Ajax (Atlas) 1.0 uses the Microsoft Permissive license. I'm not very good at legal stuff, but from what I read here, I think it can be used commercially.
|
|
|
|
|
I had a problem in sending email from asp.net 2.0.
The code which i have used for sending email follows..
First i have imported some namespaces
<br />
using System.Net;<br />
using System.Net.Mail;<br />
after, in a button click event i have written like this
<br />
string toaddr;<br />
toaddr = "stxvechoor@rediffmail.com";<br />
MailMessage message = new MailMessage();<br />
message.From = new MailAddress("sebastian@atenindia.com");<br />
message.To.Add(new MailAddress(toaddr));<br />
message.CC.Add(new MailAddress("stxvechoor@rediffmail.com"));<br />
message.Priority = MailPriority.High;<br />
message.Subject = "hai";<br />
message.Body = "Test Mail";<br />
SmtpClient client = new SmtpClient();<br />
client.Port = 2095;<br />
client.Host = "mail.ateninc.com";<br />
client.Send(message);<br />
But it showed some error..
Can anyone help me.....
I will be thankful to you...
Sebastian
|
|
|
|
|
Hi,
Which error message you get?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
First i got the error below
SMTP exception was unhandled by user code..
when i added try..catch... it showed some error like this..
mail sending failed
I couldn't understand these..
will you help me?
thanks
|
|
|
|
|
Hi all,
how to insert one data grid into another datagrid.
ex: if i select one item in one column than it will display new datagrid that should shows the related item details.
|
|
|
|
|
 This is an example:
<br />
asp:datagrid id="dgAddresses" runat="server" CssClass="grid" AutoGenerateColumns="False" GridLines="None"<br />
Width="680"><br />
SelectedItemStyle Font-Bold="True" CssClass="grid_itemSelected"></SelectedItemStyle><br />
EditItemStyle CssClass="grid_itemEdit"></EditItemStyle><br />
AlternatingItemStyle CssClass="grid_itemAlternating"></AlternatingItemStyle><br />
ItemStyle CssClass="grid_item"></ItemStyle><br />
HeaderStyle Font-Bold="True" CssClass="grid_header"></HeaderStyle><br />
FooterStyle CssClass="grid_footer"></FooterStyle><br />
Columns><br />
asp:TemplateColumn ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Top"><br />
ItemTemplate><br />
asp:ImageButton ID="ibtnViewUsers" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "lngAddressID").ToString()%>' Visible='<%#DataBinder.Eval(Container.DataItem, "CountDP").ToString() == "0" && DataBinder.Eval(Container.DataItem, "CountUsers").ToString() != "0"%>' ImageUrl="../../../../../../images/bo_icons/arrow_yellow_right_12x12.gif" AlternateText="$Click_to_view_users_conected_to_this_address$"><br />
/asp:ImageButton> <br />
/ItemTemplate><br />
/asp:TemplateColumn><br />
<br />
asp:TemplateColumn HeaderText="$Addresses$" ItemStyle-VerticalAlign="Top"><br />
ItemTemplate><br />
asp:DataGrid id="dgUsersConections" runat="server" CssClass="grid" Visible="False" AutoGenerateColumns="False"<br />
GridLines="None"><br />
SelectedItemStyle Font-Bold="True" CssClass="grid_itemSelected"></SelectedItemStyle><br />
EditItemStyle CssClass="grid_itemEdit"></EditItemStyle><br />
AlternatingItemStyle CssClass="grid_itemAlternating"></AlternatingItemStyle><br />
ItemStyle CssClass="grid_item"></ItemStyle><br />
HeaderStyle Font-Bold="True" CssClass="grid_header"></HeaderStyle><br />
FooterStyle CssClass="grid_footer"></FooterStyle><br />
Columns><br />
asp:TemplateColumn HeaderText="$Users$"><br />
ItemTemplate><br />
asp:Label id="lblUsers" runat="server"><br />
<%#DataBinder.Eval(Container.DataItem, "strName").ToString()%><br />
/asp:Label><br><br />
/ItemTemplate><br />
/asp:TemplateColumn><br />
/Columns><br />
/asp:DataGrid><br />
/ItemTemplate><br />
/asp:TemplateColumn><br />
/Columns><br />
/asp:datagrid><br />
Then you have to add an ItemCreated on the outer datagrid (dgAddresses):
<br />
#region Web Form Designer generated code<br />
override protected void OnInit(EventArgs e)<br />
{<br />
InitializeComponent();<br />
base.OnInit(e);<br />
}<br />
<br />
private void InitializeComponent()<br />
{<br />
<br />
this.dgAddresses.ItemCreated += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgAddresses_ItemCreated);<br />
this.Load += new System.EventHandler(this.Page_Load);<br />
<br />
}<br />
<br />
#endregion
This method shoud look something like this:
private void dgAddresses_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)<br />
{<br />
try <br />
{<br />
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) <br />
{<br />
DataRowView drv = (DataRowView) e.Item.DataItem;<br />
<br />
System.Web.UI.WebControls.ImageButton ibtn = (System.Web.UI.WebControls.ImageButton)e.Item.Cells[0].Controls[1];<br />
ibtn.Click += new System.Web.UI.ImageClickEventHandler(this.ibtnViewConections_Click); <br />
} <br />
} <br />
catch (Exception err) <br />
{<br />
}<br />
}<br />
the ibtnViewConections_Click:
<br />
private void ibtnViewConections_Click(object sender, System.Web.UI.ImageClickEventArgs e)<br />
{<br />
System.Web.UI.WebControls.ImageButton ibtn = (System.Web.UI.WebControls.ImageButton)sender; <br />
DataGridItem dgiRow = (DataGridItem)ibtn.Parent.Parent;<br />
<br />
if(ibtn.CommandName == "")<br />
{<br />
ibtn.ImageUrl = "../../../../../../images/bo_icons/arrow_yellow_down_12x12.gif";<br />
if(dgiRow.ItemType == ListItemType.Item)<br />
{<br />
ibtn.CommandName = "grid_item";<br />
}<br />
else<br />
{<br />
ibtn.CommandName = "grid_itemAlternating";<br />
}<br />
createConnectionsView(ibtn); <br />
}<br />
else<br />
{<br />
dgiRow.CssClass = ibtn.CommandName;<br />
ibtn.ImageUrl = "../../../../../../images/bo_icons/arrow_yellow_right_12x12.gif";<br />
ibtn.CommandName = "";<br />
removeConnectionsView(ibtn); <br />
} <br />
}
The code that adds the inner datagrid:
<br />
private void createConnectionsView(System.Web.UI.WebControls.ImageButton ibtn)<br />
{<br />
DataGridItem dgiRow = (DataGridItem)ibtn.Parent.Parent;<br />
dgiRow.CssClass = "grid_itemSelected";<br />
int lngAddressID = int.Parse(ibtn.CommandArgument);<br />
<br />
My.BusinessLogicObjects.Address bloAddress = null;<br />
try <br />
{<br />
DataView dvUsersToAddress = null;<br />
bloAddress = new My.BusinessLogicObjects.Address();<br />
dvUsersToAddress = bloAddress.GetUsersToAddress(lngAddressID); <br />
<br />
if(dvUsersToAddress.Count != 0)<br />
{ <br />
DataGrid _dgUserConections = (DataGrid)dgiRow.FindControl("dgUsersConections");<br />
_dgUserConections.Width = System.Web.UI.WebControls.Unit.Percentage(100);<br />
_dgUserConections.DataSource = dvUsersToAddress;<br />
_dgUserConections.DataBind();<br />
_dgUserConections.Visible = true;<br />
} <br />
<br />
}<br />
catch (Exception err) <br />
{ <br />
throw new Exception(Error loading result$") + " " + err.Message, err);<br />
} <br />
finally <br />
{<br />
if (bloAddress != null) bloAddress.Dispose(); <br />
bloAddress = null; <br />
}<br />
}
Then to hide the inner datagrid:
private void removeConnectionsView(System.Web.UI.WebControls.ImageButton ibtn)<br />
{<br />
DataGridItem dgiRow = (DataGridItem)ibtn.Parent.Parent; <br />
<br />
DataGrid _dgUsersConections = (DataGrid)dgiRow.FindControl("dgUsersConections"); <br />
_dgUsersConections.Visible = false;<br />
<br />
}
Hope it helps
Thomas
|
|
|
|
|
Hi to all,
I am using .NET2003, while run the Project it displaying this kind of Errors.
A project with an Output Type of Class Library cannot be started directily.
In order to debug this project, go to the Debugging tab under configuration Settings in Project Properties, and set the Start Action to start External Program or Start URL. Alternatively, You can add a non-library project to this solutions that uses a reference to this project and set it as the startup Project.
I tried with above Paragraph but I am getting same Problems.
Mohan Balal
|
|
|
|
|
Hi, how are you..?
you are trying to run a class library project which has no forms, so you will not be able to run it and you will get this type of error.
you should create one simple form application and link your class library with it and then, try to run that form application ...you will be able to debug your class library project through this path....
Bye.
Chirag Patel
|
|
|
|
|
Thanks for your reply, but. In my solution there are 26 projects. I am not about to debug it. My start Project is Home.aspx.
Mohan balal
|
|
|
|
|
Hi Mohan,
I think the start up project in your solution is your class library.
You have set "Home.aspx" as the start up page but its project is not set as a start up project.
Go to the solution explorer, right click on the project which contains "Home.aspx" and click on "Set As Start Up Project" from the pop up menu.
I hope this will solve you issue.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Thanks, I think It will solved my Problems
Mohan balal
|
|
|
|
|
Yes, the Problem is solved. Will you tell me what is this means.
The dependency 'CDO' could not be found.
Mohan balal
|
|
|
|
|
Hi,
When do you get this message?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
That Error will come while comple the Project. After complied it display this kind of Error in IE.
Invalid Site Name: xxxx
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.CommerceServer.Runtime.CommerceException: Invalid Site Name: xxxx
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
CommerceException: Invalid Site Name: xxxx ]
Microsoft.CommerceServer.Interop.Configuration.SiteConfigReadOnlyFreeThreaded.Initialize(String bstrSiteName) +4114
Microsoft.CommerceServer.Runtime.Configuration.CommerceResourceCollection..ctor(String siteName) +217
Microsoft.CommerceServer.Runtime.CommerceApplicationModule.InitializeApplication() +193
Microsoft.CommerceServer.Runtime.CommerceApplicationModule.Init(HttpApplication appInstance) +76
System.Web.HttpApplication.InitModules() +100
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1295
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +392
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +256
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +414
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Mohan Balal
|
|
|
|
|
I'm booked until later next week. If that works for you, let me know.
|
|
|
|
|
hi all,,
plz let me know the query to populate a dropdownlist with the database names available in sqlserver....!
|
|
|
|
|
SqlConnection myConnection = new SqlConnection(connectionString);<br />
SqlDataAdapter myCommand = new SqlDataAdapter("select FirstName, LastName from NameList", myConnection);<br />
<br />
SqlDataReader dr;<br />
dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection);<br />
while (dr.Read()) {<br />
myDropDownList.Items.Add(new ListItem((String)dr["FirstName"]+dr["LastName"],"")); <br />
}<br />
dr.Close();<br />
Regards,
Satips.
|
|
|
|
|
hello satips....u ahven't understand my questions
my requirement, i want to populate a dropdownlist with all the database names .....like master,nothwind,.....(my own databses)....etc
i don't want to select some columns from some table
plz help me....!
|
|
|
|
|
Sorry for the Mistake.
Try how Chetan has stated i hope that will work.
Regards,
Satips.
|
|
|
|
|
Hi,
You can do this by connecting to the "master" database of the particular SQLServer and querying "sysdatabases" table.
The following is the code sample.
SqlConnection conn = new SqlConnection("Data Source=servername;Initial Catalog=master;User ID=uid;Password=pwd");
SqlCommand cmd = new SqlCommand("select dbid, name from sysdatabases");
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
conn.Open();
SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
DropDownList1.DataSource = dr;
DropDownList1.DataTextField = "name";
DropDownList1.DataValueField = "dbid";
DropDownList1.DataBind();
dr.Close();
I hope this will solve your issue.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
thanqs chetan...this stuff worked for my requirement
|
|
|
|
|
hello chetan....plz let me know the sql query for retrieving the user tables present in the selected database
thanqs in advance..![Rose | [Rose]](https://www.codeproject.com/script/Forums/Images/rose.gif)
|
|
|
|
|
Hi,
To get all the user tables for the selected database, u have to connect to that database and query its "sysobjects" table.
"select name, id from SysObjects where Type = 'U'"
This way you can get names of all the user tables of the selected database.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
hai every one
please give one sample coding about pop-up calander asp.net 2.0 using c#.net
Dhatchinamoorthy.R
9894824838
|
|
|
|
|