|
shizam wrote:
Could you please be more specific?
Could you be more explorative? I mean, it's not that hard. If you have installed the DirectX SDK (with the managed assemblies - yes, you actually have to go to msdn.microsoft.com/directx and download it), they would show up in a search. If you still can't find them, they're installed into %WINDIR%\Microsoft.NET\Managed DirectX\vVERSION. Select the appropriate assemblies which - agian - I did give you the names of in the first place. If you don't see them, then go to a folder's Tools->Folder Options, then click the View tab and show hidden files. Any good developer should've already enabled this option since working with DLLs and other normally hidden files is necessary.
Figuring out things for yourself will teach a lot more than having people do them for you.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Well Heath, maybe you shouldn't be answering questions if you're going to be mean about it.
1) I've been trying to solve this problem over 2-3 days, so I did not immediately jump and ask for help the first time I had a problem
2) I do have "show hidden files" enabled because I've experienced those types of problems before. Your comment that "Any good developer should've already enabled.." this options is ridiculous. People make mistakes, even good developers.
3) Yes I've installed the DirectX SDK, it's a 227 MB self extracting exe that was downloaded from Microsoft's web site.
4) In the directory you specify, I only have .XML files, and no DLL files.
So please don't respond anymore unless you're going to provide answers or suggestions. If you want to ridicule people, log on to chat.yahoo.com
|
|
|
|
|
These forums are for developers, not for people looking to others to do their work for them. Check practically any replies from the regulars and you'll see it isn't just me.
Even if you've installed the DirectX SDK, there is a separate install for the managed runtime. If you took the default path for the SDK installation, the install would be in C:\DX90SDK\Developer Runtime\Managed DirectX\Retail for the release builds, or replace Retail above with Debug for the debug build.
One more thing - all this was discussed on the URL I previously gave you for the DirectX SDK download site and for other information - including samples - about DirectX 9. Reading documentation is essential, SDK documentation and installation guides.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Well I am a "professional developer", have been once since leaving college with my piece of paper.
I'm trying to set up .NET and DirectX and not having much luck here.
The directory mine was installed to was "C:\DXSDK", and that was the default.
I do NOT have the "Developer Runtime" sub-directory under there.
I'm read the readme's and most of the stuff on that link you were talking about already, no luck.
|
|
|
|
|
Go to http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp[^] and click on the Redist[^] link.
Make sure you download the Summer 2003 updates because many bugs were fixed. This is both a full and upgrade installation so you don't really need to uninstall the previous version.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
shizam wrote:
Then I wanted to use the Win32 API call PlaySound, but since it's a lib and not a dll I can't do that.
Umm... it's both. Declare it like this and you should be fine:
[DllImport("winmm")]
public static extern int sndPlaySound(string lpszSoundName, int uFlags);
|
|
|
|
|
...preloading the printPreviewDialog?
I want to disable the messagebox/dialog that shows the number of pages loading before the printPreviewDialog is shown. Is there a way around that by any chance?
Many thanks in advance.
// Loke
|
|
|
|
|
Hi,
I am trying to learn ADO.net using C# and I keep running into problems trying to insert data into my Access Database: data.mdb.
here is my code:
<br />
private string connectionStr = @"Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Data Source=""C:\data.mdb"";Jet OLEDB:Engine Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist security info=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1";<br />
private string selectStr = "Select id, date, day, time, comments, timeout, status, process from data";<br />
<br />
private System.Data.DataSet myDataSet;<br />
private System.Data.OleDb.OleDbConnection myConnection;<br />
private System.Data.OleDb.OleDbDataAdapter myDataAdapter;<br />
private System.Data.OleDb.OleDbCommandBuilder myCmdBuilder;<br />
<br />
private System.Data.OleDb.OleDbCommand mySelectCmd;<br />
<br />
public Schedule()<br />
{ <br />
this.InitilizeDb();<br />
this.PopulateDataSet();<br />
}<br />
<br />
private OleDbConnection ConnectDb()<br />
{<br />
return new OleDbConnection(connectionStr);<br />
}<br />
<br />
public void InitilizeDb()<br />
{<br />
myDataAdapter = new OleDbDataAdapter();<br />
myCmdBuilder = new OleDbCommandBuilder(myDataAdapter);<br />
myDataSet = new DataSet();<br />
}<br />
<br />
private void PopulateDataSet()<br />
{<br />
myConnection = (OleDbConnection) this.ConnectDb();<br />
<br />
mySelectCmd = new OleDbCommand(selectStr, myConnection);<br />
<br />
mySelectCmd.CommandType = CommandType.Text;<br />
<br />
try<br />
{<br />
myConnection.Open();<br />
<br />
myDataAdapter.SelectCommand = mySelectCmd;<br />
<br />
myDataAdapter.Fill(myDataSet,"data");<br />
}<br />
finally<br />
{<br />
myConnection.Close();<br />
}<br />
}<br />
<br />
public string InsertSchedule(string date, string day, string time, string process,<br />
string comments, string timeout, string status)<br />
{<br />
myConnection = (OleDbConnection) this.ConnectDb();<br />
<br />
try<br />
{<br />
myConnection.Open();<br />
<br />
DataRow newRow = myDataSet.Tables["data"].NewRow();<br />
<br />
newRow["id"] = 3;<br />
newRow["date"] = date;<br />
newRow["day"] = day;<br />
newRow["time"] = time;<br />
newRow["process"] = process;<br />
newRow["comments"] = comments;<br />
newRow["timeout"] = timeout;<br />
newRow["status"] = status;<br />
<br />
myDataSet.Tables["data"].Rows.Add(newRow);<br />
<br />
myDataAdapter.Update(myDataSet, "data");<br />
<br />
return "true";<br />
}<br />
catch(Exception e)<br />
{<br />
return e.Message + "\n\n" + e.StackTrace + "\n\n" + e.InnerException;<br />
}<br />
finally<br />
{<br />
myConnection.Close();<br />
}<br />
}<br />
the problem is when I try to insert into the database, I keep getting this Exception:
Syntax error in INSERT INTO statement.<br />
<br />
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)<br />
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)<br />
at ShutdownMgr.Schedule.InsertSchedule(String date, String day, String time, String process, String comments, String timeout, String status) in c:\documents and settings\azel\my documents\visual studio projects\shutdownmgr\schedule.cs:line 99<br />
I have tried different ways but none were successful. Is anyone able to spot where I am going wrong?
thanks.
|
|
|
|
|
Because you haven't specified a INSERT SqlCommand . The SqlDataAdapter isn't magical - you need to provide SELECT, INSERT, UPDATE, and DELETE SqlCommand s for full functionality. Specifying just a SELECT SqlCommand doesn't generate the others. If you're unsure about how to do this, read about the SqlCommand and SqlDataAdapter classes in the SDK documentation, or use drop a SqlDataAdapter onto your form or control in VS.NET and run through the wizard. Be sure to look at what source it generates though to fully understand what is going on.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Oic,
I thought the commandbuilder class is suppose to auto generate the insert, update and delete commands?
so even if i have set the commandbuilder to my data adapter, I must still initilize my insert, update and delete commands?
I will also take a look at the SDK documentation..
thanks.
|
|
|
|
|
I missed that line, sorry. The SqlCommandBuilder may have trouble with your SELECT statement. Another possibility is with the table mappings of the SqlDataAdapter . You're setting your table name as "data". Does that actually map to the name of the table from which you're selecting records? These should match and you might have to set up a table mapping using the SqlDataAdapter.TableMappings property. This fairly straight-forward.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
the dataset table name is "data" which is the same as the one from the source table name.
i got the idea from MSDN that table mapping is use when your data source and dataset names are different? So if I have used the same name do I still need tablemapping?
thanks
|
|
|
|
|
Yes, unless you use a strongly-typed DataSet . In most cases, the SELECT SqlCommand (with one or multiple result sets) loads tables by default named "Table", "Table1", "Table2", ..., "TableN". Your TableMappings should map these table names to your actual tables in your database.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
humm.. still wondering y i got the exception thrown when i try to perform an update to the database.
just wondering if you are able to point me or share with me some sample that has insert, delete and update without the use of stored procedure?
|
|
|
|
|
I did actually. Drag a SqlDataAdapter to your form or control and go through the wizard, specifying that new commands should be created instead of using new or existing stored procs. Take a look at what's generated in your source file.
You can also read the SDK documentation for SqlDataAdapter , which does have examples in various class and method documentation.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
If you do have to browse to find the assemblies and all you find are xml files of the managed assemblies then go here for the latest DirectX 9 managed download: http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp[^]
Just follow the instructs and viola you should have the assemblies. You'll know right away if you've got them installed correctly because when you fire up VS.Net you'll see the green directx logo along with your other languages on the splash screen.
Have fun!
Best,
Jerry
The only way of discovering the limits of the possible is to venture a little past them into the impossible.--Arthur C. Clark Toasty0.com
|
|
|
|
|
Wrong thread
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Oh damn! Sorry!
The only way of discovering the limits of the possible is to venture a little past them into the impossible.--Arthur C. Clark Toasty0.com
|
|
|
|
|
Hi,
I want to ask a question about how to return messages from a general class.
How should I warn the users.
When something happened that must not be done what the object must do?
The senario is, there are several classes. Each of them has specific functionality.
It seems to me that the best way is defining a class that has properties like MessageID and and the Message. User can compare the MessageID with the const integers on the class to understand what happens and takes action.
Is there a general approach?
Kind Regards
|
|
|
|
|
From what I have seen everybody has a different opinion on this one.
I say clean up and throw a descriptive exception, but there will undoubtedly be many who will say that is a bad idea and recommend output params or returning strings etc.
But my vote is on exceptions
regards,
Paul Watson
Bluegrass
South Africa
Brian Welsch wrote:
"blah blah blah, maybe a potato?" while translating my Afrikaans.
Crikey! ain't life grand?
|
|
|
|
|
Paul Watson wrote:
But my vote is on exceptions
Ditto. Exceptions are the best way to notify the class consumer of an error.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
I cast my vote for exceptions, too. A callee can pass far more data about any errors that occur to its caller in a polymorphic way that would be difficult - if not stupid - to do with out params.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
FxCop rocks! Did you know it's included in the Longhorn SDK download?
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|