473,395 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Some quetions

Dear sirs
I`ve some questions to ask concerning C#

1) I`m making my DB using MS-SQl server and connecting to
it using C#
when I try to save data in the SQL server it saves it
appending spaces to its end
and so when I try to search for some value in my tables I
don`t find it, because it is not written as I did
So how can I fix this problem??

2) I would like to connect to MS-Outlook from my
application to send an email to a specific user(s) I`ve
choosen thier emails from my application
How can I do that??

3) Is there any way that I can declare a variable that all
Forms in my application can see it (Global)

4) I would like to know if there is any control that can
view a web page in my application (I would like to
make 'Help' in my application looks like the one of the
MSDN)
Nov 16 '05 #1
3 1923
Mohammed Abdel-Razzak <an*******@discussions.microsoft.com> wrote:
I`ve some questions to ask concerning C#

1) I`m making my DB using MS-SQl server and connecting to
it using C#
when I try to save data in the SQL server it saves it
appending spaces to its end
and so when I try to search for some value in my tables I
don`t find it, because it is not written as I did
So how can I fix this problem??
I suspect you've set up your columns to be NChar rather than NVarChar.
2) I would like to connect to MS-Outlook from my
application to send an email to a specific user(s) I`ve
choosen thier emails from my application
How can I do that??
Don't know.
3) Is there any way that I can declare a variable that all
Forms in my application can see it (Global)
You can use a public static variable - but it's generally frowned upon
unless it's for a really good reason.
4) I would like to know if there is any control that can
view a web page in my application (I would like to
make 'Help' in my application looks like the one of the
MSDN)


Again, I don't know the best way of doing this.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Hi,
1) Change your table column types to variable-length types. (Like varchar,
nvarchar)
2) You can use SQL-Mail, Microsoft CDO 1.21 Library, or "Microsoft Outlook
xx.x Object Library" by adding a com reference. A sample is below.
3) Don't know but, would not be a good design. In my opinion, review your
class design.
4) Microsoft Web Browser Component(shdocvw.dll). But you can use MS HTML
Help to provide user help. And u can make better deisgns with HTML Help
Workshop.

Good Luck
Adnan

Mail Sample:
Microsoft.Office.Interop.Outlook.Application OL = new
Microsoft.Office.Interop.Outlook.ApplicationClass( );
Microsoft.Office.Interop.Outlook.NameSpace OLNS =
OL.GetNamespace("MAPI");
Microsoft.Office.Interop.Outlook.Folders OLFld = OLNS.Folders;
Microsoft.Office.Interop.Outlook.Explorer explorer =
OL.Explorers.Add(OLNS.GetDefaultFolder(OlDefaultFo lders.olFolderDrafts),
OlFolderDisplayMode.olFolderDisplayNormal);
explorer.Activate();
Microsoft.Office.Interop.Outlook.MailItem mail =
(Microsoft.Office.Interop.Outlook.MailItem)
OL.CreateItem(OlItemType.olMailItem);
mail.To = "to";
mail.Subject = "subject";
mail.Body = "body";
mail.Send();
OL.Quit();

"Mohammed Abdel-Razzak" <an*******@discussions.microsoft.com> wrote in
message news:1b*****************************@phx.gbl...
Dear sirs
I`ve some questions to ask concerning C#

1) I`m making my DB using MS-SQl server and connecting to
it using C#
when I try to save data in the SQL server it saves it
appending spaces to its end
and so when I try to search for some value in my tables I
don`t find it, because it is not written as I did
So how can I fix this problem??

2) I would like to connect to MS-Outlook from my
application to send an email to a specific user(s) I`ve
choosen thier emails from my application
How can I do that??

3) Is there any way that I can declare a variable that all
Forms in my application can see it (Global)

4) I would like to know if there is any control that can
view a web page in my application (I would like to
make 'Help' in my application looks like the one of the
MSDN)

Nov 16 '05 #3
in addition to Jons post, make sure you are not writing data with trailing
spaces to sql in the first place because even with variable length types
ANSI PADDING is set to ON by default meaning that trailing blanks not
trimmed (no padding to column length though). Regardless this is the
recommended behaviour that should be used, *but* as suggested use variable
length db types (varchar, nvarchar etc) if you do not want padding to the
original length of the column.

p.s.Nullable fixed length columns with ANSI PADDING OFF setting set will
display the same behaviour as the variable types with this OFF i.e trailing
blanks trimed and no padding (but best to stick to variable types in the
first place unless absolutely necessary)
--
Br,
Mark Broadbent
mcdba , mcse+i
=============
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Mohammed Abdel-Razzak <an*******@discussions.microsoft.com> wrote:
I`ve some questions to ask concerning C#

1) I`m making my DB using MS-SQl server and connecting to
it using C#
when I try to save data in the SQL server it saves it
appending spaces to its end
and so when I try to search for some value in my tables I
don`t find it, because it is not written as I did
So how can I fix this problem??


I suspect you've set up your columns to be NChar rather than NVarChar.
2) I would like to connect to MS-Outlook from my
application to send an email to a specific user(s) I`ve
choosen thier emails from my application
How can I do that??


Don't know.
3) Is there any way that I can declare a variable that all
Forms in my application can see it (Global)


You can use a public static variable - but it's generally frowned upon
unless it's for a really good reason.
4) I would like to know if there is any control that can
view a web page in my application (I would like to
make 'Help' in my application looks like the one of the
MSDN)


Again, I don't know the best way of doing this.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: PHPkemon | last post by:
Hi there, A few weeks ago I made a post and got an answer which seemed very logical. Here's part of the post: PHPkemon wrote: > I think I've figured out how to do the main things like...
10
by: Jeff Wagner | last post by:
I am in the process of learning Python (obsessively so). I've been through a few tutorials and read a Python book that was lent to me. I am now trying to put what I've learned to use by rewriting...
22
by: Martin MOKREJ© | last post by:
Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9
3
by: fdsl ysnh | last post by:
--- python-list-request@python.orgдµÀ: > Send Python-list mailing list submissions to > python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, > visit >...
9
by: TPJ | last post by:
First I have to admit that my English isn't good enough. I'm still studying and sometimes I just can't express what I want to express. A few weeks ago I've written 'Python Builder' - a bash...
1
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
0
by: raghuveer | last post by:
i am a beginer to c progamming .Please give a list of some tricky quetions or links u have..it would be a great help
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.