|
hey..
the code works completely fine..
pls check the name of the checkbox u have placed and the name u have given in the FinControl Method is same.
it works fine.
where there is a will there is a way
|
|
|
|
|
OK,
I am about to pull my hair out, and this is why.
I am building a webpage using asp.net (c#), that collects data via a form. The data is saved to a mysql db.
Now I have a ms word document on my pc that is a template. It has certain sections where the data colected from the form needs to be inserted. Now of course a mail merge is the perfect solution but how do i do this?
I would love to have it done on the server, but I have read and searched and cant find any easy way to do, or any way at all for that matter. I thought I found a solution is JSisys's WordReport. But going to there website I noticed it has dissapeared, with no mention. Is there anyway I can do this using asp.net on the server?
I know I can do this manually on my pc, if i just export a text file containing the data from the web form and use that file to perform a mail merge with ms word open, but there must be a way where i can eliminate the manual process of opening word and doing it that way??????
I have looked at automation from a c++ program but I belive this just opens word and automates it this way. And I dont wish to word to open everytime someone submits the form...
Can anyone help me out? It would be so much appreciated I cant explain.
Cheers
|
|
|
|
|
IMHO, to perform mail merge at the server side you'll basically have two options a/ Use the Automation[^], but I don't prefer this way. b/ Use a third party component like Aspose.Word[^].
|
|
|
|
|
The PasswordRecovery uses SMTP configurations specified in web.config. How I do to specify this in runtime? I wish get these parameters from my database instead.
Kind Regards
Jesus is Love! Tell to someone!
|
|
|
|
|
Hi there. You can use the SendingMail event of the control to send the notification email with the settings stored in DB.
|
|
|
|
|
Cool, thank you very much.
Jesus is Love! Tell to someone!
|
|
|
|
|
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
private string _connectionString = ConfigurationSettings.AppSettings["ConnectionString"];
protected void Page_Load(object sender, System.EventArgs e)
{
if (!(Page.IsPostBack))
GetData();
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
}
#endregion
private void GetData()
{
SqlConnection connection = null;
SqlCommand command = null;
SqlDataReader reader = null;
SqlParameter parameter = null;
try
{
connection = new SqlConnection(_connectionString);
connection.Open();
command = new SqlCommand("select * from nametable where id = @id", connection);
parameter = new SqlParameter("@id", SqlDbType.Int);
parameter.Value = 1;
command.Parameters.Add(parameter);
reader = command.ExecuteReader(CommandBehavior.CloseConnection);
if (reader.HasRows)
{
reader.Read();
nameTextBox.Text = Convert.ToString(reader["name"]);
}
}
catch (Exception ex)
{
// throw;
}
finally
{
if (reader != null)
((IDisposable)reader).Dispose();
if (connection != null)
{
if (connection.State == ConnectionState.Open)
connection.Close();
connection.Dispose();
}
}
}
private void UpdateData()
{
SqlConnection connection = null;
SqlCommand command = null;
SqlParameter parameter = null;
try
{
connection = new SqlConnection(_connectionString);
connection.Open();
command = new SqlCommand("update nametable set Name.name = @Name where id = @id", connection);
parameter = new SqlParameter("@Name", SqlDbType.VarChar);
parameter.Value = nameTextBox.Text;
command.Parameters.Add(parameter);
parameter = new SqlParameter("@id", SqlDbType.Int);
parameter.Value = 1;
command.Parameters.Add(parameter);
command.ExecuteNonQuery();
}
catch (Exception ex)
{
finally
{
if (connection != null)
{
if (connection.State == ConnectionState.Open)
connection.Close();
connection.Dispose();
}
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
Label1.Text = nameTextBox.Text;
}
protected void updateButton_Click(object sender, EventArgs e)
{
UpdateData();
}
}
*** i keep getting this stupid message : Error 1 } expected *** pls help
|
|
|
|
|
Count your angle brackets.
For one you are not closing your catch block before the finally block.
---
b { font-weight: normal; }
|
|
|
|
|
Those are curly brackets/braces, angle brackets are like "< >". Though, technically they aren't true angle brackets (angle is wider and character is thinner on real angle brackets).
However, missing brackets (or something hiding a bracket, like a comment) is definitly the problem. The error message comes right out and says it.
|
|
|
|
|
You are correct. I was of course meaning curly backets.
---
b { font-weight: normal; }
|
|
|
|
|
I'm trying to build a website for a client. He represents several artists and wants to display their art on the web. One of the key features he wants is so that a user can't download any picture they want (whether by right clicking and doing a save as or what ever)
I've seen an implementation on PHP that uses a "OnRightClick" and overrides the browers normal functions. How ever there were still a few ways to get around that.
I was wondering if anyone had some good ideas or suggestions on how to do this.
Drathmar
Drathmar
|
|
|
|
|
|
I was fairly sure that images could not be 100% protected.
How ever, if there are some good ways to make it difficult to strip an image from a page. So that the average user would atleast have a hard time doing stripping the image, I'd be happy.
Drathmar
|
|
|
|
|
Hi,
I am Ravindra currently doing a project in ASP.net, I want to work with DataList or Repeater.
Even after googling I dint found any better results about this topics,
if anybody know these links, please specify.
Thanks in advance--
Ravindra
|
|
|
|
|
What is it you are trying to accomplish? There are many articles here and elsewhere that give very good examples of how to work with these controls.
only two letters away from being an asset
|
|
|
|
|
Hello!
I used this code, and it works to not allow duplicates:
Dim li As New ListItem
For Each li In LB1.Items
If li.Selected = True Then
If Not ListBox2.Items.Contains(li) Then
ListBox2.Items.Add(li)
End If
End If
Next
After the items are added, my second goal is to sort them ASC too. Haven't quite figured that out as well. Any suggestions are appreciated.
Thanks!
-- modified at 9:57 Monday 7th August, 2006
|
|
|
|
|
I'm not exactly sure what it is you are trying to do here however to avoid duplicates you could insert the items into a hashtable and bind the listbox to it.
only two letters away from being an asset
|
|
|
|
|
Thanks Mark!
I got the duplicate code to work...I actually put the code in the wrong listbox.
So, I'll try the hashtable with the listbox items then for the sort.
|
|
|
|
|
Where do you get the items from? If you for an example get them from a database, it's easier and more efficient to remove duplicates and sort in the database query, than writing code for it.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa,
I get the items from a db call to populate the left listbox on my page. The user will click on this listbox to transfer the "number" over to the right side listbox, Listbox2, on the page.
I'm trying this code to sort the items in Listbox2, but get:
At least one object must implement IComparable.
Dim items As New ArrayList(ListBox2.Items)
items.Sort()
ListBox2.DataSource = items
|
|
|
|
|
Implement an IComparer for ListItem, and use that in the call to the Sort method.
But, shouldn't you do this using client script instead? If you use server code to move the items, you will be sending a lot of data back and forth between the server and the client.
---
b { font-weight: normal; }
|
|
|
|
|
Got it to work with this:
http://www.411asp.net/func/content?tree=411asp/tutorial/specific/web/userinte/webcontr/listbox&id=5881410
Thanks to all for the help!
|
|
|
|
|
I’m new to ASP.NET and I have been having trouble developing some of the client-side script. I have two webforms that are in two frames in a window. The first webform has a datagrid and the second (main webform) has javascript that will updates it’s contents based on the selected value in the datagrid. I would like to execute specific script on the main webform when the user makes a selection in the datagrid. I would also need to send the datagrid’s selected value to the main webform. I can’t find any references about this process. Any input on this would be appreciated.
|
|
|
|
|
|
If your subject is the same as the qustion, either the subject is way too long, or the question is way to short.
In this case, obviously, it's the second. You have to explain a lot more about what you are trying to do.
---
b { font-weight: normal; }
|
|
|
|