|
You can't by default - VSS assigns rights to the following operations only:
Read
Check out/in
Add/Rename/Delete
Destroy
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hello,
I am creating a website for my father. It is for his new magazine and he asked me i've I could create a contact form.
So his customers can ask questions to him or give feedback.
And i really don't know how to create something like this. I have read some tutorial's but they didn't help me well.
At the moment i have something like this but probaly this is wrong.
<code>
MailMessage contactMail = new MailMessage();
contactMail.From = new MailAddress("txtMail.Text");
contactMail.Subject = "Hallo! Test 01";
contactMail.Body = "<p>Body</p>";
contactMail.IsBodyHtml = true;
I hope some one can send me a good 'How to' or anything that will help me.
I would be very thankfull!
Greetings,
Bas
|
|
|
|
|
|
I want to have the number as ##9.9 only if there is a decimal point but if it's 0 then it should be ##0? at the same time I want to round to upper so it should 57.3 if it's 57.3 but it should be 58 if it's 57.6
|
|
|
|
|
That isn't easy, mostly because your requirements conflict:
How should 59.9 be printed?
Your first requirement says "59.9", but your rounding says it should be 60.
Decide exactly what you want to do, and try again!
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in.
Apathy Error: Don't bother striking any key.
|
|
|
|
|
if I correctly understand your post
double i = 11157.0;
Console.WriteLine(i.ToString("#.#"));
else clarify it plz
|
|
|
|
|
if your formatting isn't one of the built-in ones, just write a method ("MyToString()") that formats it any way you like; and don't hesitate to use as many statements as you need to get it done. Then use your method everywhere it applies.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I am thinking of this certificate as SAMPLE..
Certificate Sample
I want to know how can I print a name and fill the (For) field using C# then print on this image so the final will be a new image?
|
|
|
|
|
Using either guesswork or a paint program, work out the size and placement in pixels of the area you want to write in.
Then, with your image loaded into an Image derived control such as a Bitmap called myBlankCertificate
using (Graphics g = Graphics.FromImage(myBlankCertificate))
{
g.DrawString(myCertificateOwnersNameString,
fontIWantTheNamePrintedIn,
brushColourAndSoForth,
rectanglefIFoundEarlier);
} You may want to play with the Graphics.Clip region, but that is up to you.
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in.
Apathy Error: Don't bother striking any key.
|
|
|
|
|
Hi,
By default sql server will accept date format of mdy.is it possible to change the format to dmy.
SET DATEFORMAT dmy
GO
INSERT tDateOrder (d) VALUES ('31/1/04')
GO
INSERT tDateOrder (d) VALUES ('2/28/04')
by executing the above statement im getting the below error.
(1 row(s) affected)
Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.
is it possible to change the database format as dmy permanently? and also it should change only for this particular database.
Regards
Kanna
|
|
|
|
|
Wrong forum!You should better post your question to General database forum.
Dotnetkanna wrote: INSERT tDateOrder (d) VALUES ('2/28/04')
It isn't valid date,[EDIT]if the date format is dmy which means day/month/year. [/EDIT]
An year contains 12 months not 28.You may consider change to query to:
<br />
INSERT tDateOrder (d) VALUES ('28/2/04')<br />
Life is a stage and we are all actors!
|
|
|
|
|
You shouldn't be passing strings to the database for dates. If you use parameterized queries the conversion happens for you automatically.
Parameterized Queries[^] This example only shows text, but if you use the following syntax it will do all the type checking before it gets to the database.
cmd.Parameters.Add("@MyDate", SqlDbType.DateTime);
cmd.Parameters["@MyDate"].Value = yourDateTimeVariable;
This is also the recommended way to do queries to prevent SQL injection attacks becuase it also handles things like single quotes and other things you would have to escape manually.
|
|
|
|
|
I am doing Project in OPC.In that project,when ever user create Group means,it has to create in Database also in runtime.I am using Sql Server 2005 and C#.My Question is how to create table with four columns in database at run time using c#.I am waiting for your reply.
Thanks and Regards
M.Raghu
|
|
|
|
|
You could always just write the SQL to create a table and execute it using a SqlCommand , but a better way to do it would be to use Sql Server Management Objects (SMO).
private void MakeMyTable()
{
string connectionString = "...";
using (SqlConnection connection = new SqlConnection(connectionString))
{
Server server =
new Server(new ServerConnection(connection));
Database db = server.Databases["MyDatabase"];
Table newTable = new Table(db, "MyTestTable");
Column pk = GetColumn(newTable, "id", DataType.Int, false);
pk.Identity = true;
pk.IdentitySeed = 1;
pk.IdentityIncrement = 1;
newTable.Add(pk);
DataType varchar = new DataType(SqlDataType.NVarChar, 50);
newTable.Add(GetColumn(newTable, "Name", varchar, false));
newTable.Add(GetColumn(newTable, "Nickname", varchar, true));
newTable.Add(GetColumn(newTable, "Title", varchar, false));
Index index = new Index(newTable, "PK_MyTestTable");
index.IndexKeyType = IndexKeyType.DriPrimaryKey;
index.IndexedColumns.Add(new IndexedColumn(index,"id"));
newTable.Indexes.Add(index);
newTable.Create();
}
}
private Column GetGolumn(Table tb, string columnName, DataType type, bool isNullable)
{
Column column = new Column(tb, columnName);
column.DataType = type;
column.Nullable = nullable;
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hello,
I have developed an desktop application in C#.NET Framework(3.5). My client is using the application on different OS like(Xp, Seven, Vista). I have developed the app and did over all testing on XP. Now some features of app are not working on Seven and Vista for which i need to do some extra work. Is there any piece of code in c# by which i can check which operating system is installed and them my app according to that OS.
Thanks in Advance,
Asfand
|
|
|
|
|
Take a look at System.Environment.OSVersion .
System.Environment.OSVersion.Version.Major will return one of the following:
4 = Windows 95, 98, ME or NT 4.0
5 = Windows 2000, XP or 2003 Server
6 = Vista, Windows 7 or 2008 Server
Then query the System.Environment.OSVersion.Version.Minor
See the following for detailed break down of version numbers of Windows OS.
Life Rocks 2.0[^]
MSDN[^]
|
|
|
|
|
You can use Environment.OSVersion to get the OperatingSystem back. From this you can determine whether or not it's a Vista+ system with a simple check:
public bool IsVistaOrHigher
{
get { return OSVersion.Version.Major >= 6);
} If the application can run in compatibility mode though, this is potentially unreliable. Another way to do this is to use a method that only exists in a Vista (or greater) OS to determine it. Here's another example that demonstrates it:
public bool IsVistaOrHigher
{
get
{
return IsVistaOrHigherHelper();
}
}
private bool IsVistaOrHigherHelper()
{
IntPtr hModule = LoadLibrary("Kernel32.dll");
if (hModule != null)
{
IntPtr proc = GetProcAddress(hModule, "MoveFileTransactedA");
return proc.ToInt32() != 0;
}
return false;
} I used part of the Kernel Transaction Manager (KTM) to do this - you can use any new API to accomplish the same.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
What you change depends on what your app is doing. If properly written, you shouldn't need to check the O/S version to modify the apps behavior.
|
|
|
|
|
Dave is absolutely right. First make sure you have to know which OS version your app is running on. Oftentimes people think they need to know while they really don't. A typical example would be the use of special folders, such as "My Documents", which seems to be located at different locations on different Windows versions. However there is a simple way to get that path without worrying about the OS version at all; that too is inside the Environment class.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
While this is good advice, there are certain occassions where this check does count. Suppose you want to use the Kernel Transaction Manager, for instance. If your application runs on Vista+ it will work, but it won't on XP. You should be able to provide a graceful degrade mechanism at this point.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I fully agree, feature detection is part of, well, decent behavior. But it is Microsoft's duty to hide those tiny changes that don't bring much, and make things needlessly hard, and sometimes they do provide a solution, with people not always aware of it.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Luc Pattyn wrote: make things needlessly hard
A perfect description.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Very true, but I don't think the OP is using anything platform specific.
|
|
|
|
|
Why do you make that assumption? The OP has not posted anything about that...
|
|
|
|