|
Well thanks for the help but DirectX doesn't want me to learn it evidently.
The samples DO not work. I constantly get the error I describe. I did exactly waht you said I installed the sdk. I then ran the msi to install the managed directx. i then go to vs.net and click on directx wizard and it crashs saying it needs microsoft.directx.dll.
I even try it without the wizard and run the samecode compile and then run, and i get the same exact error. Its obviously a problem cause I have seen it all over the net but i can't seem to find a solution. They basically say the same thing are you but its simply not working for me.
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
If it's not finding the assembly, then go to the Managed DirectX runtime directory (usually in %WINDIR%\Microsoft.NET\Managed DirectX and run gacutil.exe /i on the assemblies you find in there. This will install them into the GAC so that they can be resolved by the CLR.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
Here is the start of my webservice Update method. How does this look? Did I leave anything out? Can I use messagebox object inside a webservice? If this is running on the server it wouldn't be viewable to client correct?
<br />
<br />
public bool UpdateDB(dataset dsDiff)<br />
{<br />
string sSQL;<br />
<br />
sSQL = @"SELECT * From MidnightReadings";<br />
<br />
SqlConnection myCon = new SqlConnection("user id=username;" + <br />
"password=password;server=localhost;" + <br />
"Trusted_Connection=yes;" + <br />
"database=database; " + <br />
"connection timeout=30");<br />
<br />
UpdateDB = false;<br />
<br />
try<br />
{<br />
SqlDataAdapter da = new SqlDataAdapter(sSQL,myCon);<br />
SqlCommandBuilder cb = new SqlCommandBuilder(da);<br />
cb.GetInsertCommand();<br />
cb.GetUpdateCommand();<br />
da.Fill(dsDiff,"MidNight");<br />
da.Update(dsDiff);<br />
<br />
}<br />
catch(SqlException e)<br />
{<br />
string errorMessage = "Message: " + e.Message + "\n" +<br />
"Source: " + e.Source + "\n" +<br />
"State: " + e.State + "\n" +<br />
"Procedure: " + e.Procedure + "\n";<br />
<br />
System.Diagnostics.EventLog log = new System.Diagnostics.EventLog();<br />
log.Source = "Web Service: wsMNMhzData Encountered an Error";<br />
log.WriteEntry(errorMessage);<br />
Console.WriteLine("An exception occurred. Please contact your system administrator.");<br />
}<br />
<br />
<br />
<br />
<br />
return true;<br />
}<br />
<br />
Thanks,
JJ
|
|
|
|
|
MrJJKoolJ wrote:
Can I use messagebox object inside a webservice?
You can't.
MrJJKoolJ wrote:
cb.GetInsertCommand();
cb.GetUpdateCommand();
These lines are not needed. They will set automaticlly.
MrJJKoolJ wrote:
Console.WriteLine("An exception occurred. Please contact your system administrator.");
If you want to inform user an error occured , you can thrown SoapException and report it in your client. That line won't work. Also you can return a error code instead od throwing exception
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Hi Mazy,
How do I return an Error code back to the client from web service?
Thanks,
JJ
|
|
|
|
|
Just set return value as an integer , which you can define for yourself that each number refer to specific error. You can return it in your catch block and outside it return 0 , just like many of win32 API do. Other way as I mentioned throwing SoapException which could be caught in client. You can search for it in Google for sample. Hope it helps.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Hi Gurus,
i am using following code to send request to php page on button click function:
HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://www.umc.ua/misc/sendsms.php");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
string postData = "network1="+oper.Text+"&Phone1="+phone.Text+"&Message="+text.Text+"&sender_name=sn";
byte[] buffer = Encoding.ASCII.GetBytes(postData);
request.ContentLength = buffer.Length;
Stream s = request.GetRequestStream();
s.Write(buffer, 0, buffer.Length);
s.Flush();
s.Close();
But when I lauching my program and clicking much times on to invoke this code an exception occurs:
"Unable to write data to the transport connection"
It happens aproximately every 10-15 times. Could someone tell what wrong with my code? Thanx
www.xedom.com
|
|
|
|
|
First, you should encode the param values or they could be used to crack your CGI and beyond.
Second, are you actually getting the response from the server using request.GetResponse , or are you just queueing requests?
Finally, are the param values the same each time you click the button in your test case?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
Second, are you actually getting the response from the server using request.GetResponse, or are you just queueing requests?
I was gonna mention that, but I havent used it in such a long time, I thought I'll rather let someone else do it
|
|
|
|
|
Yes, all parameters are the same. Let imagine that this is one dialog with single button and all code are implemented in OnButton click function. This button just sends an sms to a mobile through php page, so I do not need any server response. But when I sending 20-30 sms during 10 min. after each 10-15 clicks I got this exception message. Can you tell me how can I encode my param values? Thanx for reply.
www.xedom.com
|
|
|
|
|
You could either reference the System.Web.dll assembly, or the JScript.NET assembly (don't remember off-hand what it's called) and use the HTML encoding method in there, or just do a simple replacement yourself, using Uri.HexEscape for all ASCII characters about 127 (implementing this your isn't hard either - just replace the character with &#XXX; where XXX is the decimal number equivalent. So, character 128 would be €.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am trying to pass a parameter to one of the OnSelectedIndexChanged events. Is this even possible ?
Code-Behind is C#.
Here's the Front-End Sample..
<asp:dropdownlist autopostback="True" id="SomeID" runat="server" onselectedindexchanged="ChangeIndex">
Here's What I want to achieved..
<asp:dropdownlist autopostback="True" id="SomeID" runat="server" onselectedindexchanged="ChangeIndex(1)">
So my method is ChangedIndex. Usually, if i leave it as is,
it will work. But I'm trying to make a generic function that
can be use for all.
Code-Behind.
public void ChangeIndex(object sender, EventArgs e)
{
do some stuff..
}
this works, but no parameters.
I tried:-
public void ChangeIndex(int i_temp)
{
do some stuff..
}
this gave me error.
Any sample syntax is appreciated.
Stanley
|
|
|
|
|
Which control are you talking about? More than one control in WINDOWS FORM have this event. Most of them have the property name SelectedIndex or SelectedItems which you can use to get that value.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
I think its related to webforms
|
|
|
|
|
Sorry for being unclear.
Yeah, it's webform related.
Stanley
|
|
|
|
|
I found it out. This is posted in ASP.NET forum too.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
If you haven't yet solved your issue, please see my reply in the ASP.NET forum.
--Jesse
|
|
|
|
|
Hello,
I am currently having a hard time finding any good references for the needleman wunsch algorithm to learn and implement it in C#.
Does anyone please have a reference or can help me by supplying pseudo or proper code?
10x
Andrew Cortis
|
|
|
|
|
Sounds like a lunch meat. You should google on "Needleman Wunsch java", in my opinion; here's a result to get you started:
http://www.dina.dk/~sestoft/bsa.html
It's ridiculously easy to port code from Java to C#, and you're probably going to have better luck in general finding science- or math-oriented code written in Java.
-Jeff
here, bloggy bloggy
|
|
|
|
|
10x a lot. I'm not a java guru, but I'll try to understand it from Java code.
|
|
|
|
|
I think you'll find it easier than you think, and if you have questions, come back and see us. Good luck.
-Jeff
here, bloggy bloggy
|
|
|
|
|
Does somebody know in which Dll and Namespace I can find
the Session - Object (if there is any )? thanks
|
|
|
|
|
Which Session do you mean? The one in ASP.NET? System.Web.SessionState Namespace ?
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
If you actually read the documentation, you'd see that it's in the System.Web.dll assembly under the System.Web.SessionState namespace (as Mazdak mentioned). You can't simply just use it, though. It's bound to the current HttpContext for a user. You can get this from the HttpContext.Current property (returns the current HttpContext , the class which defines a Session property) and the Page class.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
here is my log file from fuslogvw.exe
*** Assembly Binder Log Entry (5/6/2004 @ 10:49:28 AM) ***
The operation failed.
Bind result: hr = 0x800704c7. The operation was canceled by the user.
Assembly manager loaded from: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable C:\Program Files\Droplet\Server\DropletConsole.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = DotNetAppHost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15043562efa7be39
(Fully-specified)
LOG: Appbase = C:\Program Files\Droplet\Server\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : DotNetAppTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15043562efa7be39.
===
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: DotNetAppHost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15043562efa7be39
LOG: Cache Lookup was unsuccessful.
ERR: A fatal error occurred when retrieving next codebase for download (hr = 0x800704c7).
i can't figure out what the error is. did it fail to find one of the assemblies - DotNetAppHost or DotNetAppTest?? or is it something else??
thanks.
|
|
|
|