Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 20th, 2007, 06:26 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mail Merge in Web

Hello, I’m an ASP beginner. I work for a very small company and the person who usually takes on the computing role is on leave and I’m the need person in line :o!

My boss needs me create some form of mail merge to our asp web site, so all people with admin rights to the site can print labels off. This would involve calling the names from SQL Server, having an option to select all or choose names from a list and then printing them out.

I’m a little over my head as I don’t have much knowledge, I hope somebody can help.


Reply With Quote
  #2 (permalink)  
Old November 20th, 2007, 09:57 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

It is not clear what you are asking.

First: is this being done in Classic ASP or ASP.NET (you have posted in the ASP.NET forums).
Second: ASP and ASP.NET have no built in ability to access mailboxes. Sending email from ASP and .NET applications is simple enough but checking email is not a trivial task.

You have said that the users need to print labels off, how is this related to Merging mail?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote
  #3 (permalink)  
Old November 20th, 2007, 05:22 PM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry I'll explain, i should have named it better (My boss called it mail merge and i got confused). Yes it is asp.net.

The web site is connected to SQL Server which has client contact details. As this is at a remote server, staff members would like to print contact details onto printed labels from the website. I would also like to have an option to select all contacts or to select them one by one.


P/S Sorry should i place this in a different forum.
Thank you for your quick reply

Reply With Quote
  #4 (permalink)  
Old November 20th, 2007, 05:29 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This is the correct forum.

This is actually pretty simple since all you want to do is produce a contact list that only a subset of employees can see.

How familiar are you with ASP.NET? How involved does the app need to be? What do you know in so far as this project is related? Are you looking for someone to guide you all the way through the project? Are "Admins" defined through an Active Directory or is there a table in your database that defines people as Admins?



================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote
  #5 (permalink)  
Old November 20th, 2007, 05:48 PM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your quick reply.

I have some small knowledge of asp.net, as i helped to design the companies website. and have some knowledge in getting tables to return data from sql server but this was a number of few years ago.

The printed labels (section) of the website will only be accessible to admins, so yes there is a section that defines people as admins.
At the moment all we have is a website and an sql database.

It would be very helpful to have someone guide me through the process, or any form of help would most appreciated.

I thinking the process should involve:
1. Call just contact names i.e into a table
2. Select required contacts using check box or select all
3. Submit button will print these selected contacts onto label paper

Thank you very much for quick response


Reply With Quote
  #6 (permalink)  
Old November 20th, 2007, 07:40 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

But HOW do you define someone to an Admin role? The way you go about authenticating some one in the Admin role in Active Directory is much different from doing a look up in a SQL Server table that defines a person as an admin.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote
  #7 (permalink)  
Old November 21st, 2007, 07:12 AM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is a table in the database that defines people as Admins

Reply With Quote
  #8 (permalink)  
Old November 21st, 2007, 11:30 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Ok I will break this down for you. First you need to provide your users a way to login to your application, these controls will help you accomplish that: http://msdn2.microsoft.com/en-us/library/ms178329.aspx These controls support the addition of roles, however, it seems an unecessary step since only admins should ever access this site. So what I would do is alter my SQL query to only validate people in the admin role, something like:

SELECT
p.pk,
p.Name
From users p
INNER JOIN roles r ON r.person_fk = p.pk
WHERE p.username = @userName and p.password = @password AND r.RoleID = 'Admin'

(This is only an example meant for illustration, but you should get the idea of what I am doing)

That should handle your Login.

Now as far as the Contact List is concerned, I am not sure the best way to do this since you have not said how many Contacts there are.

In the past when I have done this my clients have always had very specific requirements for filtering their Contacts lists, for example they would never randomly select 2 or 3 people that they wanted to mail things to it was always that they were mailing something to a specific group of people, for example, people that paticipated in XYZ event.

So let me know if your system has the same type of flexibility or if it is completely possible for someone to select 2 or 3 people at random to create labels for.

Lastly, about directly printing things to labels, this could be trial and error. I have only ever sent data to a label printer a handful of times and it was through a windows app where I had a very fine control of how the printdoc was sent to the printer. This should be the least of your worries at this point.

hth.


================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote
  #9 (permalink)  
Old November 21st, 2007, 12:18 PM
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for the great breakdown, it is helping me alot. I understand what you say by having only admins access the site.

There is about 80 contacts at the moment. Each contact can sign up to recieve different event information so i guess it can be filtered for which event information that they sign up to. (There is a choice of 6 events)




Reply With Quote
  #10 (permalink)  
Old November 21st, 2007, 01:41 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Ok.

I might use a dropdownlist that contains these values:
All
Event 1
Event 2
Event 3
Event 4
Event 5
Event 6

On Page_Load bind All of the contacts to the gridview so all 80 would be showing. (You may or may not want to do this.)

Handle the OnSelectedIndexChanged event of your DDL and then rebind your gridview based upon the value in the DDL how you do this will largely depend on if the values in your database are key values or simply text values.

At that point you have the information that you need, you will just need to play around with it to make sure that the information is printed correctly.

Let me know if you have any further questions.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Problem prasanta2expert Access VBA 2 April 26th, 2011 03:23 AM
mail merge from access dfisher BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 1 October 17th, 2008 08:09 PM
ASP-XML Mail Merge jfn12587 Classic ASP XML 1 January 11th, 2006 07:16 AM
Need Help In Mail Merge raghur Access VBA 0 September 8th, 2005 05:46 AM
mail merge from query nabrown78 Access VBA 3 April 4th, 2005 08:23 PM



All times are GMT -4. The time now is 10:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.