|
hi, iam having the table fields
name nvarchar(50),
emailid nvarchar(50),
startdate datetime,
enddate datetime.
when the end dates comes before ten days we have to remind him that your contract is left for 10 days only. for every 2 days he should get the reminder . when the date ends then he should get the message that you are not in contract how to do this.
|
|
|
|
|
There are several ways to accomplish this Like
-Create a windows service which check the databse and send the mails accordingly to all.
- Create a exe which which check the databse and send the mail and schedule this exe to a specific time daily in windows scheduler.
....Cheers!!
Brij
|
|
|
|
|
Hi all
Can u give the any example because same thing i need to implement
Thanks and regards,
Amit Patel
|
|
|
|
|
|
Please follow the following steps
-Develop a console Application which will do the following things
-- Connects to DB and get the list of all the recipients where you need to send the reminder mail.This you can calculate with the help of enddate.This list you can prepare by C# also.Do as per you convenience.
-- Create/get a mail format that is to be sent the reciepients.
-- Loop all the reciepients, update the subject and mail body according to the reciepient and send mail one by one.
-- Create a task in windows scheduler,which will execute your exe at regular interval.
Please let me know if you face problem at any step.Cheers!!
Brij
|
|
|
|
|
please give me the same example.which helps me. iam getting errors
|
|
|
|
|
can you give a small example for this .which helps me
|
|
|
|
|
Hi all,
can you please guide me, how to insert multiple insert using this code.
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "usp_Information";
for (Int64 acct = 1000000000000001; acct <= 1000000000024000; acct++)
{
String sAcct = Convert.ToString(acct);
SqlParameter p1 = new SqlParameter();
p1.ParameterName = "@ShawNumber";
p1.SqlDbType = SqlDbType.VarChar;
p1.Direction = ParameterDirection.Input;
p1.Value = sAcct;
SqlParameter p2 = new SqlParameter();
p2.ParameterName = "@UserId";
p2.SqlDbType = SqlDbType.Int;
p2.Direction = ParameterDirection.Input;
p2.Value = 88578539;
SqlParameter p3 = new SqlParameter();
p3.ParameterName = "@ParentShawNumber";
p3.SqlDbType = SqlDbType.VarChar;
p3.Direction = ParameterDirection.Input;
p3.Value = "22";
cmd.Parameters.Add(p1);
cmd.Parameters.Add(p2);
cmd.Parameters.Add(p3);
cmd.ExecuteNonQuery();
}
Here cmd.ExecuteNonQuery(), it is use for single insert statment, i want to insert multiple records at a time, please guide me.
Thanks in Advance.JohnDas
|
|
|
|
|
What are you doing?
The way you had put
cmd.Parameters.Add(p1);
cmd.Parameters.Add(p2);
cmd.Parameters.Add(p3);
in for loop, the same three parameters keep on adding again and again.
Does this method works fine for you? I doubt 2nd execution would work!
|
|
|
|
|
hi every one,
i have one problem in my web application,i have two layouts.
iam giving user can change the header colors and font size in the css.but how to save user changes colors and font size.. and where ?
give me information or give url's..
thanks to all
|
|
|
|
|
Google "asp.net themes".45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
|
Hello -
I want to get the index of the row where the button is clicked.
Please note that I am using EventArgs, not GridViewCommandEventArgs, since with GridViewCommandEventArgs nothing is happening, once the button is clicked.
Thx, Laziale
|
|
|
|
|
laziale wrote: not GridViewCommandEventArgs, since with GridViewCommandEventArgs nothing is happening
Can you post your code?Cheers!!
Brij
|
|
|
|
|
hello
thx for your reply and here is my code:
backend:
protected void updateNote(object sender, GridViewCommandEventArgs e)
{
string selectedIndex = "";
int index = 0;
index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = gvOrderNotes.Rows[index];
ListItem item = new ListItem();
item.Text = Server.HtmlDecode(row.Cells[3].Text);
selectedIndex = item.Text;
}
html:
<ItemTemplate>
<asp:Button runat="server" ID="ChkUpdate" onclick="updateNote" AutoPostBack="true" Width="160%" Text="Update Order"/>
<ajaxToolkit:ConfirmButtonExtender ID="chkUpdateConfirmBtnExtender" runat="server" TargetControlID="chkUpdate" DisplayModalPopupID="modalPopupExtenderChkUpdate"></ajaxToolkit:ConfirmButtonExtender>
<ajaxToolkit:ModalPopupExtender ID="modalPopupExtenderChkUpdate" runat="server" TargetControlID="chkUpdate" PopupControlID="pnlChkUpdate"
OKControlID="chkUpdateOK" CancelControlID="chkUpdateCancel" BackgroundCssClass="modalBackground" />
</ItemTemplate>
Thx for your help one more time.
Laziale
|
|
|
|
|
Why dont you use rowcommand event of gridview..
use your button like in the linkCheers!!
Brij
|
|
|
|
|
You have to use e.RowIndex , where e is EventArgs .
|
|
|
|
|
there is no rowIndex under EventArgs e.
I have just Equals, GetHashCode, GetType and ToString.
Thx for your help though.
Laziale
|
|
|
|
|
try this,
Add commandArgument in <asp:button> tag
<asp:Button ID="Button1" runat="server" Text='<%#Eval("YourDataFiled")%>'
CommandArgument = "Button1" OnClick = "Button1_Click" />
c# code
protected void Button1_Click(object sender, EventArgs e)
{
Button button = (Button)sender;
string CommandName = button.CommandName;
string CommandArgument = button.CommandArgument;
int index = Int32.parse(button.CommandArgument);
}
Hope this helps.
|
|
|
|
|
Hei,
I've some special characters like æ ø å and when I use these chars it display correct in the label but when i bind that field with a Gv they are converted in to ø or any other number at the place of 248. What is the solution for this problem.
ThanksSyed Shahid Hussain
|
|
|
|
|
To handle special characters,you can use javascript functions escape() and unescape() to encode and decode.this will allow to display the special charactersCheers!!
Brij
|
|
|
|
|
Thanks Brij Syed Shahid Hussain
|
|
|
|
|
Just, set the HtmlEncode property of your BoundField to False.
Like:
<asp:boundfield datafield="Character" headertext="Character" htmlencode="false" />
</asp:gridview>
|
|
|
|
|
Hei
Thanks a lot Sandeep Mewara You had solved my problem.
for u Syed Shahid Hussain
|
|
|
|
|
Hi All,
I need to implement on my form, a feature to automaticaly store the old value of the cotnroles on a database if the user press a button to save the value. One way is to code it for each control on the ButtonClick event but it's too heavy to do and no fearly nice.
So, a good way is to declare inherited controls, add properties and declare events. On the form, when the user press the button, raise the event and for each control whose has the value changed and saved it to disk.
I need also to pass arguments on the Event to stored it on the database.
I have implemented the following but the event on the custom controls is not fired. So I do not know what is wrong.
First:
On the /APP_Code subdirectory, I have created a class called "MyControls" like this:
namespace MyControls
'need this class to customize argumentso to pass in tge event
Public Class SaveEventArges
myproperties...
End Class
Public Delegate Sub SaveEventHandler (ByVal sender As Object, ByVal e as SaveEventArgs)
Public Class ComboBox
Inherits .....
myproperties and methods ...
Public Event Save as SaveEventHandler
Protected Overridable Sub OnSave (ByVal sender As Object, ByVal e as SaveEventArgs)
RaiseEvent Save(me, e)
End Sub
Protected Sub ComboBox_Save ( ByVal sender As Object, ByVal e as SaveEventArgs) Handles Me.Save
mySaveCode
End Sub
End Class
end namespace
Second: On my form
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" >
<%@ Register TagPrefix = "mc" Namespace = "MyControls" %>
...
<mc:combobox runat="server" id="TextComboBox" ><="" mio:combobox="">
<asp:button runat="server" id="Btn" text="Press">
....
On the code behind:
Imports MyControls
....
Public Event Save As SaveEventHandler
Protected Sub Btn_Click ....
Dim t as New SaveEventArgs
my t... properties to pass to the event
RaiseEvent Save (me., t)
End Sub
What am I doing wrong?
I spent 4 days reading how to do it and no way to found a solution, so please i need your help.
RegardsJulien Lacotse
|
|
|
|