|
Somewhere in this mess you've released a resource (i.e. Disposed of it) - my guess would be that it's the connection that's causing you problems.
"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
|
|
|
|
|
Don't post VB trash outside the VB forums and then vote down someone like Pete when he provides you with freely given advice.
|
|
|
|
|
Hi,
I have developed a code to create a ms-access table through VB.NET as mentioned below.
ADOXtable = New ADOX.Table
ADOXtable.Name = "ACN_CHARX_INSTANCE"
ADOXtable.Columns.Append("LOGICAL_DB_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("DIM_NAME", ADOX.DataTypeEnum.adVarWChar, 32)
ADOXtable.Columns.Append("CHARX_NAME", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_TABLE", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_VALUE_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("VALUES_UNIQUE", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_ORDER_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("CHARX_ORDER", ADOX.DataTypeEnum.adInteger)
ADOXtable.Columns.Append("CHARX_NUMERIC_COL", ADOX.DataTypeEnum.adVarWChar, 128)
ADOXtable.Columns.Append("BITMAP_COL", ADOX.DataTypeEnum.adVarWChar, 128)
cat.Tables.Append(ADOXtable)
Now i want to set primary key constraints for this table through coding. Please share your ideas...
Thanks,
Sivakumar.M.
|
|
|
|
|
|
Hi,
How many primary key constraints can we have in a table of ms-access? Any other constraints available in ms-access other than primary key?
Please share your ideas...
Thanks,
Sivakumar.M.
|
|
|
|
|
This question has nothing to do with .NET. Please ask in the Database forum.
|
|
|
|
|
For all its in the wrong forum.....
How many primary key constraints can you have in any database table? That'll be one, although the primary key can be made up multiple columns.
|
|
|
|
|
Hi everyone,
Now I have a Crystal Report file, and I print this file with Epson T88IV. But it prints so slowly.
When I type a Print Command in Commandline of Windows to print a Text File, It prints immediately. But It can print Unicode Text. It prints ASSCII only.
My print command
Print D:\temp.txt /d:com1
Can I print a Crystal Report File immediately? How Do I Do?
Thanks so much.
modified on Thursday, June 18, 2009 1:25 AM
|
|
|
|
|
Practically speaking you cannot print the crystal report in ASCII format.
The system sent the output to the printer in form of Image.
But when you send the same request from DOS prompt, the data is send as ASCII
|
|
|
|
|
Thanks for you reply.
Can you show me How Do I print it with UniCode font so Quickly?
I know when I use a print dialog in another software, firstly It converts my text to image and then the printer work.
If I convert Text to image then I Print a image file. Does it print immediately?
Thanks.
|
|
|
|
|
We solved this problem once. But we were not using the Crystal report
But you can give the try
We used a grid control.. format it and then send it to the printer.
We never submit the document to the normal printer. But try to install 9-Pin IBM printer, set it as default printer and submit the document to this printer.
Any how this solved our problem
|
|
|
|
|
Hi Guys,
I've got some dates i'm storing in a database and XML file, and when i read them out and compare them to the origional date that remained in code, they return false due to a loss in precision.
Is there any easy way to compare dates with a certain precision comparison? Or trim the precision on dates in code? The ones i have go all the way down to the milliseconds.
Cheers
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Hi,
DateTime.Date sets you back to midnight, which is fine for a timeless date compare.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
ya I have tried it. Its perfect
DateTime d1 = DateTime.Today;
DateTime d2 = DateTime.Today.AddMilliseconds(1);
if (d1.Date.CompareTo(d2.Date) == 0)
{
Response.Write("Ya its equal");
}
else
{
Response.Write("No its not equal");
}
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
Thanks Luc, is there any way to do date and time, without the MS? It's just possible that there might be multiple values for the same day, so that's not really fine grain enough for me!
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Hi,
it all depends on what you want exactly.
1.
if parts of the DateTime should be identical, then check those parts, as in:
DateTime dt1=...;
DateTime dt2=...;
if (dt1.Date==dt2.Date && dt1.Hours==dt2.Hours) isSufficientlyEqual();
the problem now is that 16:59:59 would equal to 16:00:00 and not to 17:00:00 which is much closer!
2.
if time distance is important, calculate it
DateTime dt1=...;
DateTime dt2=...;
if (dt1.Date==dt2.Date) {
float seconds=dt1.Subtract(dt2).TotalSeconds;
if (seconds>-100 && seconds<100) isSufficientlyClose();
}
3.
Up to the second equal:
DateTime dt1=...;
DateTime dt2=...;
if (dt1.AddMilliseconds(-dt1.MilliSeconds)==dt2.AddMilliseconds(-dt2.MilliSeconds)) {
isPrettyClose();
}
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
|
That's a nice idea! Something to stick in the Common Lib. ^^
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Ah, i was wondering if there was a existing or simpler way. I could have done it by now ><
I think between that and some extention methods, i can solve the problem nicely.
Cheers!
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Depending on which database you are using, you may see some loss of precision when you store a datetime (aka timestamp in some databases). SQL Server, for example, does not store datetime values to the exact millisecond. It is only accurate to approximately the nearest 3 milliseconds. So if it is important to get accurate timestamps right down to the exact millisecond, you should avoid the SQL Server datetime datatype.
SQL Server 2008 introduces a new datatype, datetime2, which is accurate to approximately 100ns to get around this problem.
Possible solutions:
- if you are using SQL Server 2008 and have ownership of the database, use datetime2 rather than datetime
- if you are not using SQL Server 2008 or you cannot change the table design and if you do not need millisecond accuracy, decide what accuracy you do need: for example, round off your timestamps to the nearest second before storing them
- if you do need millisecond accuracy, either convert the timestamp to a string format (OK for XML, not good for date functions and the conversion to and from datetime type may be slow) or store the timestamp as the number of milliseconds from the epoch (gives you the accuracy you need at a reasonable performance but not good for date functions)
|
|
|
|
|
I'm not too fussed about the loss of precision, i can deal with the nearest second. But thanks for the input. Is there any easy way to round a date? I've always created new dates and copied the relevant values over before.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
One of the earlier replies from Luc shows you how to do this. Yes, you have to create a new DateTime (it is immutable so once you've created one you can't change it) but there is an easy way to do it using AddMilliseconds. Sounds like a good candidate for an extension method if you're at the right version of .NET. Otherwise, a good old fashioned DateUtils class would do.
|
|
|
|
|
|
PIEBALDconsult wrote: May I humbly recommend DateTruncate?
Waiting for V2.0, with a Compare method added to it.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
You'll be waiting a long time if you don't make a request.
I suppose I could make a TimespanTruncate.
|
|
|
|