|
I did a Google and found this.
I haven't downloaded it and don't know if it's complete / a good reference, but it does say that source is included.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards "It'll be a cold day in Hell when I do VB.NET...", Chris Maunder
|
|
|
|
|
Heey thanks a lot, before I asked I did a google search but under c# not under c-sharp
Thanks a lot
|
|
|
|
|
As title,
I have some existing incoming email and would like to put them to the inbox of outlook. Can I? What is the code?
Thanks
|
|
|
|
|
Hi,
Q1: How can I transfer an SQL database manually? I have a database which is named mydb, I looked at the harddrive and found it on "C:\Program Files\Microsoft SQL Server\MSSQL\Data" there is 2 file one of them is mydb.mdf and the lof file of that. I copied these on another machine on the same path but couldn't make it to work???
Q2: I used the below code to EMPTY a table which is named people but it is not working???:
SqlConnection mySqlConnection4 = new SqlConnection("Initial Catalog=mydb;Data Source=" + comboBox1.SelectedItem.ToString() + ";Integrated Security=SSPI;");
mySqlConnection4.Open();
SqlCommand mySqlCommand4 = mySqlConnection4.CreateCommand();
SqlTransaction myTrans;
myTrans = mySqlConnection4.BeginTransaction(IsolationLevel.ReadCommitted,"SampleTransaction");
mySqlCommand4.Connection = mySqlConnection4;
mySqlCommand4.Transaction = myTrans;
mySqlCommand4.CommandText = "EMPTY people" ;
//mySqlCommand4.ExecuteNonQuery();
myTrans.Commit();
mySqlConnection4.Close();
Anyway What is the problem???
Any help would be greatly appreciated...
Cem Louis
|
|
|
|
|
Q1: What was the error message when you tried to attach it to the SQL Server on the other machine?
Q2: At a quick glance the line with the ExecuteNonQuery() is commented out. Also, I cannot find the EMPTY keywork in the Transact-SQL reference. Are you sure you are using the right command? I would have used DELETE.
Do you want to know more?
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
i'm trying to have a particular picture fade in and out on my form. so the simplest way i thought to achieve this would be to embed another form on my mainform, add a picturebox to that embedded form, and fade that embedded form in and out by incrementing/decrementing the opacity on that embedded form. problem is, changing the opacity on that embedded form does nothing. anyone know why? is there something i need to do differently when changing opacity with embedded forms? is there any easier way i can accomplish this? perhaps just inc/dec the alpha values on the image itself? will that work?
any suggestions/help appreciated!
|
|
|
|
|
|
i don't think having 2 forms is a good idea.
maybe you can set the Alpha property of the image by defining System.Drawing.Imaging.ColorMatrix something like:
float[][] matrixItems ={
new float[] {1, 0, 0, 0, 0},
new float[] {0, 1, 0, 0, 0},
new float[] {0, 0, 1, 0, 0},
new float[] {0, 0, 0, xxxf, 0},
new float[] {0, 0, 0, 0, 1}};
System.Drawing.Imaging.ColorMatrix colorMatrix = new System.Drawing.Imaging.ColorMatrix(matrixItems);
where xxx is the desired alpha value. its a float between 0 and 1. Now create an image attrbute:
System.Drawing.Imaging.ImageAttributes imageAtt = new System.Drawing.Imaging.ImageAttributes();
Finally, draw the image using the DrawImage function of a Graphics object you have created from your pictureBox, panel, etc. to which you pass the ImageAttributes object you've just created
there are no facts, only interpretations
|
|
|
|
|
So, I get a type and I want to check to make sure it supports +, say, and then use it. But operators don't show up for Type.GetMembers() or for Type.FidMembers() or for Type.InvokeMembers(), at least as far as I can tell (and I did make sure I was looking for STATIC members), unless I am doing something wrong. So how do I get at these elusive operators?
"In a mad world, only the mad are sane."
|
|
|
|
|
This works for me.... The following is the operator code.
class TestClass
{
public static TestClass operator ++(TestClass tc)
{
// do work here
return tc;
}
}
The following is the reflection code....
TestClass tc = new TestClass();
MethodInfo[] methods = tc.GetType().GetMethods(BindingFlags.Public | BindingFlags.Static);
this way also works...
TestClass tc = new TestClass();
MemberInfo[] members = tc.GetType().GetMembers(BindingFlags.Public | BindingFlags.Static);
|
|
|
|
|
Ah, indeed. Yeah, I was doing basically that. The difference was I was doing it in general, and passing in a primitve, for which it evidently does not find operators. Not sure how to get around that problem.
|
|
|
|
|
So apparently with primitives the operators are completely built in. This would make sense, since they are in every other language, but somehow one assumes everything will work the same way as the in C#.
So, I suppose I can just check if the object is a primitve that would support the operation I want in addition to checking the supported methods. I looove special cases
"In a mad world, only the mad are sane."
|
|
|
|
|
ok i know i can use the method below to find a record using a prime key how do i search on a key that is not a prime key i am useing both sql and foxpro databases
conn.Open();
string search="someString";
OleDbDataAdapter da = new OleDbDataAdapter("select * from test",conn);
DataSet ds = new DataSet("test");
da.FillSchema(ds,System.Data.SchemaType.Source,"test");
da.Fill(ds,"test");
DataRow current;
current=ds.Tables["test"].Rows.Find(search.ToUpper().Trim());
if(current != null)
{
}
da=null;
ds=null;
current=null;
conn.Close();
thanks
chad
|
|
|
|
|
AFAIK you can only use the Find* method on PKs. You can however try using the DataView and using a RowFilter
|
|
|
|
|
I'm creating a custom program that's going to be used to run a "presentation station". The presentation station should enable the user to supply photos from any camera.
I need to replace the windows camera wizard with my own wizard. I'm going to provide some of the functionality of the original one, and a more elegant UI.
How would I approach this? Would Windows Image Acquistion Automation Layer do the job?
A few details. I need to be able to do the following...
- Most importantly - automatically start my wizard when camera is detected. (i would like the scanner to be ignored if possible)
- Transfer images to computer
- Delete image on camera
- Get thumbnails is optional - can be accomplished by getting full images and creating thumbnails manually
|
|
|
|
|
hi everybody,
i have some provlems ti find a good way to make difference between 2 datetime.
for example i want the difference between the DateTime.Now and 2004-05-03 12:56:32.
And i would like to have the result like 0year 4m ?h ?m ?s .
DO you have any idea plz.
thx in advance !
|
|
|
|
|
DateTime a;
DateTime b;
TimeSpan ts = a - b;
|
|
|
|
|
well i have already test this , but the results are strange :/
DateTime dt = new DateTime(2004,05,17,04,45,20);<br />
DateTime dt2 = DateTime.Now;<br />
TimeSpan ts = dt2-dt;<br />
DateTime result2 = new DateTime(ts.Ticks);<br />
Console.WriteLine(dt2.ToString());<br />
Console.WriteLine(dt.ToString());<br />
Console.WriteLine(result2.ToString());<br />
Console.WriteLine(result2.ToString("y'y' M'M' dd'd' H'h' mm'm' ss's'"));
Here are the results :
26/09/2004 00:46:50
17/05/2004 04:45:20
12/05/0001 20:01:30
1y 5M 12d 20h 01m 30s
isn't it strange ?
|
|
|
|
|
Apusnaias Wrote:
Here are the results :
26/09/2004 00:46:50
17/05/2004 04:45:20
12/05/0001 20:01:30
1y 5M 12d 20h 01m 30s
isn't it strange ?
I think you mean especially strange that you get 1 year. This happens from the Creation of the DateTime object result2. As the MinValue of DateTime is 0001/01/01 00:00:00, you get this date plus the difference between the to dates.
With the TimeSpan object ts you get the difference in seconds, minutes, hour and days; but not for months and years, as this is depending on the Month and year (a Month can have between 28 and 31 days).
For more Info I recommend the MSDN Documentation about TimeSpan and DateTime.
Greets
Roland
Wenn Du diesen Satz irgendwo liest, ignoriere ihn.
|
|
|
|
|
hi everybody,
im working on animation project, i need to know how to save a sequence of gif images in a single file in order to create an animated gif, i searched the msdn files but couldnt find anything useful. can anybody help me out??
huda
|
|
|
|
|
Hi all,
I am writing a function in C#, which is a method in a class to swap two integers which are the data members of the class. I think pointers must be used only in an unsafe context.
can anyone tell me how to define unsafe context in my problem...here is the function.
using System;
using System.Drawing;
using System.Drawing.Imaging;
namespace SpineAnalyzer
{
public class ConvMatrix
{ --- members initialisation----
public void Swap(int *x, int *y)
{
int temp;
temp=*x;
*x=*y;
*y=temp;
}
public void Flip_Hor()
{
Swap(&TopLeft11,&BottomLeft31);
Swap(&TopLeft12,&BottomLeft32);
Swap(&TopLeft13,&BottomLeft33);
Swap(&TopLeft21,&BottomLeft21);
Swap(&TopLeft22,&BottomLeft22);
Swap(&TopLeft23,&BottomLeft23);
Swap(&TopLeft31,&BottomLeft11);
Swap(&TopLeft32,&BottomLeft12);
Swap(&TopLeft33,&BottomLeft13);
Swap(&TopMid1,&BottomMid3);
Swap(&TopMid2,&BottomMid2);
Swap(&TopMid3,&BottomMid1);
Swap(&TopRight11,&BottomRight31);
Swap(&TopRight12,&BottomRight32);
Swap(&TopRight13,&BottomRight33);
Swap(&TopRight21,&BottomRight21);
Swap(&TopRight22,&BottomRight22);
Swap(&TopRight23,&BottomRight23);
Swap(&TopRight31,&BottomRight11);
Swap(&TopRight32,&BottomRight12);
Swap(&TopRight33,&BottomRight13);
}
public void Flip_Ver()
{
Swap(&TopLeft11,&TopRight13);
Swap(&TopLeft12,&TopRight12);
Swap(&TopLeft13,&TopRight11);
Swap(&TopLeft21,&TopRight23);
Swap(&TopLeft22,&TopRight22);
Swap(&TopLeft23,&TopRight21);
Swap(&TopLeft31,&TopRight33);
Swap(&TopLeft32,&TopRight32);
Swap(&TopLeft33,&TopRight31);
Swap(&MidLeft1,&MidRight3);
Swap(&MidLeft2,&MidRight2);
Swap(&MidLeft3,&MidRight1);
Swap(&BottomLeft11,&BottomRight13);
Swap(&BottomLeft12,&BottomRight12);
Swap(&BottomLeft13,&BottomRight11);
Swap(&BottomLeft21,&BottomRight23);
Swap(&BottomLeft22,&BottomRight22);
Swap(&BottomLeft23,&BottomRight21);
Swap(&BottomLeft31,&BottomRight33);
Swap(&BottomLeft32,&BottomRight32);
Swap(&BottomLeft33,&BottomRight31);
}
public void Flip_Hor_Ver()
{
Flip_hor();
Flip_ver();
}
}
here is the error i'm getting
:-Pointers may only be used in an unsafe context
can anybody help in how to implement pointer for my function and how to call from other methods of the same class.
thanks in advance,
Pavan.
Suman
|
|
|
|
|
|
Hi,
it helped tough and I am able to fix the function definition... but the only other repeated error was
----: You can only take the address of unfixed expression inside of a fixed statement initializer.. wht is a fixed statement initializer and unfixed expression... i did went through MSDN, but not able to understand their definition and the way they r defining...
here is how i defined my methods
unsafe static void Swap(int *x, int *y)
{
int temp;
temp=*x;
*x=*y;
*y=temp;
}
unsafe public void Flip_Hor()
{
Swap(&TopLeft11,&BottomLeft31);
Swap(&TopLeft12,&BottomLeft32);
Swap(&TopLeft13,&BottomLeft33);
Swap(&TopLeft21,&BottomLeft21);
Swap(&TopLeft22,&BottomLeft22);
Swap(&TopLeft23,&BottomLeft23);.....
.
.
.
}
Are my method definitons are wrong?
or should i have to add anything more...
anotehr error is...
Method System.Windows.Forms.Form.CenterToParent not found.
I have implemented a form to take a value as a parameter to my program.... but in its defintion it is giving the above error. The same form is workin well in another project, but givin the above eroor in another project..any idea why it is like tht...
can anyone help me....
thanks in advance,
Suman
|
|
|
|
|
with a little reference into the Professional C#... i have resolved my problems....
thanks
Suman
|
|
|
|
|
I have this byte[] variable with an UNICODE encoded string. The string is not null terminated, but I know its size. What is the fastest way to convert the byte[] to a string?
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|