tdsserver35.exe Error when connecting to SQLCE 3.5 DB’s(on a device) from the Desktop

October 31, 2008

i recently came across this problem when trying to access a sqlce 3.5 db on a device from the desktop… after some googling i found the fix.

problem: when you try to connect to a sqlce 3.5 db on a device, form the desktop using sql management console 2008 or VS 2008sp1(yes 2008 without the sp won’t give this error ,btw you can’t connect to a sqlce 3.5 db with sql management console 2005 or vs 2005) you might get a error like this in the device…

An unexpected error has occoured in TDSSERVER35.EXE

Select Quit and then restart this program, or select Details for more information.

System.Net.Sockets.Socket.

DETAILS:

TDSSERVER35.EXE

ObjectDisposedException

and something like this in the sql management console on the desktop…

Cannot connect to Mobile Device\Program Files\zooApp\zooApp.SDF.

——————————
ADDITIONAL INFORMATION:

Microsoft SQL Server Compact and/or .NET Compact Framework v2.0 or later is not properly installed on your mobile device or the device is not responding. (SQL Server Compact ADO.NET Data Provider)

this is happening because you don’t have the sqlce 3.5 sp1 installed on your device(vs2008 sp1 will install the desktop version of sqlce sp1, but not the device version…). get it from here. after installing it,

go to the folder …:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\armv4i in your desktop and get the two cab files listed bellow installed in your device.

  1. sqlce.wce5.armv4i.CAB
  2. sqlce.dev.ENU.wce5.armv4i.CAB
  3. sqlce.repl.wce5.armv4i.CAB

note: these might change depending on your device and your ‘needs’ (ie: if you don’t need replication you won’t need the 3rd file)…

now everything should be fine.

ref: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3745016&SiteID=1

download links for sqlce 3.5 sp1: http://blogs.msdn.com/stevelasker/archive/2008/08/07/sql-server-compact-3-5-sp1-released.aspx


XmlSerializer.Deserialize(Stream s) Strips \r out of \r\n !

August 8, 2008

I encountered a bug recently on one of the projects that i am working on. basicaly the program was getting user input through a text box(after wich all the user data gets saved as a object’s properties…) and then seriallizing it to XML and writing it to a DB. afterwards when the user wants to view this data the program would read it off the DB and deserialize the XML string to a object, that can be reprecented to the user.

when the user hit return in the text box to get to a new line it would result in ‘\r\n’ which represents a both carriege return and a new line. now when this data gets serialized, it goes in to the DB as it should. everything is fine until then. but when you try to deserialize this data that includes ‘\r\n’ using XmlSerializer.Deserialize(Stream s), it would strip the ‘\r’ out of every place where you have ‘\r\n’. this made my text boxes display some unreadable chars! this is happening because of the way XmlSerializer.Deserialize(Stream s) works. more details here(this is the page that solved my problem and teached me most of the stuff i am writing here :D ).

a quick solution would be to use something like this…

XmlSerializer.Deserialize(new XmlTextReader(Stream s))

here when you create a XmlTextReader, its XmlTextReaderproperty is by default set to false. but when you use the above mentioned XmlSerializer.Deserialize(Stream s) overload, it internally create a XmlTextReader and sets it’s XmlTextReader to true. which causes the ‘Bug’.

hope this will save some of your/my time in the feutre.


Adding Compact Framework Design-Time Attributes, DefaultValue Attributes

July 3, 2008

i was trying to add a dsign time attribute to one of my project. and the attribute was DefaultValue. i tried adding it following the example given here. But it didn’t work out for me. after experimenting for sometime i figured it out(with some help ;) ).

this is the example given in the above blog post.

        <Property Name="SelectAllOnFocus">
          <Browsable>true</Browsable>
          <Category>Behavior</Category>
          <Description>Determines whether the contents of the control should be selected when focus is moved to the control.</Description>

          <DefaultValue>
            <Type>bool</Type>
            <Value>false</Value>
          </DefaultValue>

        </Property>

but i needed to change it as follows to make it work for me.

        <Property Name="SelectAllOnFocus">
          <Browsable>true</Browsable>
          <Category>Behavior</Category>
          <Description>Determines whether the contents of the control should be selected when focus is moved to the control.</Description>

          <DefaultValue>
            <Type>System.Boolean</Type>
            <Value>false</Value>
          </DefaultValue>

        </Property>

basically i needed to give the full namespace to the type. like in System.Boolean... just bool won't work.
hope this will save some time for someone. :)

RB Source Code Released!

May 21, 2008

if you are a user of RB/RM2 then you must have noticed that recently there was no updates to RB. unfortunetly i have been too busy with my life. and Ratiomaster seems to busy too. so there was no work done in RB. IMO RM is a really neat piece of S/W. there is nothing really like it over there. I personaly prefer shu mod for cheating. and i think it is the most safe/practical thing left to cheat with. but it can’t really replace the void left by RM. RM still works but its very risky to use it!

So i am releasing the source of RB/RM2. its public now and its licened under GPLv2! ;) so all you hackers out there, who wants your freedom, now you can play and hack around with RB if you like. and make something better. i don’t know… just use your imagination. most prolly there will be some people who fork this code base to create there own clients. like copy paste this code and call it GRM :P or something like that. that is the nature in the ratio cheating community i guess :( anyways i hope there will at least someone who will carry this forward and keep it open at the sametime.

Happy Coding!

moofdev post: http://www.moofdev.org/forums/index.php/topic,2762.0.html

Direct Link: http://ratiomaster2.googlecode.com/files/RatioBlaster.source.code.release.1.rar

SVN Repo: https://ratiomaster2.googlecode.com/svn

Google Project: http://code.google.com/p/ratiomaster2


The breakpoint will not currently be hit. No symbols have been loaded for this document.

May 16, 2008

this post is a followup to

http://geekswithblogs.net/dbutscher/archive/2007/06/26/113472.aspx.

i had the same problem(the one in the tittle), and i tried all the steps sugguested in the given URL. but i couldn’t get it fixed. and when i viewed symbol info from the module window. i found out that the IDE is tring to load symbol info from a wrong path. note that i copied this solution in action from a another PC accross the local network. so then i tried deleting each and every .user(user extention) file in the soloution directory. volla! it worked then :)

The IDE was now loading the symbols from the correct path. i had to set some settings after deleting the user files though :P

note: you will find a projectA.project file and a projectA.user file when you create a project in VS IDE. same goes to a soloution. and this is the .user file that i am talking about.


How to Read Private Fields Through Reflection In .net

February 22, 2008

After a long while, no i am not in a mood to blog right now! lol but still i just wanted to share/save this code snippet here in my blog as i could’t  think of a better place :P

Basically this code works on dot net compact framework. and it was written so that i can read a table name that is stored inside a SQLCeResultSet object… this code uses reflection to archive this task :)

//load the assembly by the given name
Assembly asm = Assembly.Load(“System.Data.SqlServerCe”);
//get the type of MetaData the class that holds the needed field
Type MetaData = asm.GetType(“System.Data.SqlServerCe.MetaData”);
//get the Field info for the needed field, baseTableName
FieldInfo FIbaseTableName = MetaData.GetField(“baseTableName”, BindingFlags.Instance | BindingFlags.NonPublic);
//get the FieldInfo for the metadata property in the SQLCeDataReader class.
FieldInfo fi = typeof(SqlCeDataReader).GetField(“metadata”, BindingFlags.Instance | BindingFlags.NonPublic);
//get the metadata array
IList metadataArray = (IList)fi.GetValue(rsSeek);
//get the table name that we want
Debug.Assert(metadataArray.Count > 0);
string tableName = (string) FIbaseTableName.GetValue(metadataArray[0]);

thats it folks, i hope this would help someone out in the future(including my self :) ). read the comments if you have any doubts about how this works.


RatioBlaster

September 22, 2007

after some heavy hacking with RM’s source, i have come up with something called RB ;) take a look!

Release of RatioBlaster 0.15 beta

http://www.moofdev.org/forums/index.php/topic,2395.0.html

Download Links

RB skinned version…(this version is OLD, please consider downloading the clean version till a new skinned version is released)

http://www.moofdev.org/forums/index.php?action=dlattach;topic=2395.0;attach=231

RB clean version

http://www.moofdev.org/forums/index.php/topic,2414.0.html

w00t! feel so good to do some programing after all! :P


Reverse Engineering NRPG RM!

September 6, 2007

NRPG Ratiomaster is a small standalone application which fakes upload and download stats of a torrent to almost all bittorrent trackers.
This means that it does NOT rely on your bittorrent client (uTorrent, Azureus, etc.) and it will NOT download/upload the files on a torrent – it only can fake download/upload.
NRPG RatioMaster has hardcoded emulations for the most commonly used BitTorrent clients: uTorrent, BitComet, Azureus, ABC, BitLord, BTuga, BitTornado, Burst, BitTyrant, BitSpirit.

NRPG RM is a RM mod. it is based on RM 1.4. it is actively maintained and have any new features when comparing to RM.  Now i reverced engineered RM. and these days i am busy(well… to be ohenset i am busy watching SG1!!! these days… it have influenced me a damn lot… man i love SG1! its a grate show), getting RM in to a single class. that means i just wanna make a class that will perform normal tasks done by RM. so that i can better hadel it… and improve on it. and if i succesfully complete taking RM in to a class. it will enable me to do a lots of things… hmmm yeah a lot of things! hehe but i have to do the ‘hard part’ first.

I am using VS C# IDE to develop RM. but i have tried out MonoDevelop, #develop… too. #develop is very cool! it is more faster and really responsive than VS… but RM developed in VS. and it seems that GUI designer code of VS is not recognized by #develop :( this is really sad… if it worked that way i could have very easily moved my project to #develop…. it’s GPLed too! so whats more :) lol…

anyways back to NRPG RM. well nrpg rm was not so easy to decompile at first. cause it seemed that it was not a normal .net assembliy!!! lol i tried to  decompile it with .net reflector and some other stuff… even with the defult tool which comes with VS. but no luck it says that it doesn’t have msil headers! :P it seems that nrpg was compiled to native code by the devs… to protect the source may be. given that nrpg reverce engineered RM when he started out his program, i am pretty sure he thought of the possibility that someone can try to decompile nrpg as well. so he must have applied some protection.

nrpg was a nice person cause he released a nrpg version for mono as well! so that people like my self could run it in linux and any other nix that can run mono. thanks nrpg for doing this. but anyways i believe he could not do the same compiling to native code thing to the mono version of nrpg rm. and as a result the version for mono was easily decompiled using dot net reflector(love this piece of software!!!) . ASAF i can understand most of the RM’s basic stuff was not changed. nrpg have made RM a component. which i recognize as the main thing he have done. so by doing that and implementing tabs, he generates components in the runtime. so u can run many RMs simultaneously…

however this way of implementing has its draw backs too…. i think it slows RM a lot… jsut think, every time you call a new tab its a new set of components! it is heavy on memory… and kinda slow too… but it doesn’t mean this nrpg rm is bulshit! it is a very good software…

I could have developed my custom RM upon nrpg’s rm but i think i am better off with modding the clean, original RM. nrpg version have some fancy controls which makes things more heavy on memory… and the code. and hey after all for me, the simple code is much better anyways, its easier to understand it, it easier to change it…

I hope to finish developing my custom version of RM as fast as i can lol hehe if it wasn’t the stargate series i would have finished doing most of the stuff… in the basic RM class implementation. but i am seriously addicted to SG1, and i have to watch at least three episode per day… :D


Reverse Engineering RM

August 28, 2007

RatioMaster is an application designed for spoofing uploads on BitTorrent trackers. It connects to a tracker and behaves like a normal BitTorrent client, but without actually uploading to / downloading from other peers in the swarm. It reports to the tracker that it’s uploading (or downloading or both, it’s your choice) at a certain rate, thus making it useful for artificially increasing your ratio on certain sites that track a user’s overall ratio (total uploaded/total downloaded).

RM is grate. but unfortunately it is not very actively maintained now days… which is bad. i recently decompiled RM. and right now i am having fun hacking it. RM seems to be a very nice app. but i am sure that people like OiNK(n TMT, tracker admins..etc) could have figured out some ’signatures’ that RM process. to catch it in action. i am not sure about this. i don’t know if there was a sig or not. i don’t know what it could be if there is a one(or more than one). It seems RM uses some libraries. etc BytesRoad libs…. so it is possible that some common bug or some sig in these libs can make RM detectable on trackers.

Anyways i did at some custom features to RM and recompiled it. so i can use it for faking of course! :P but it wasn’t very straight forward process. cause when i decompiled RM to c# using

.NET Reflector 5.0 / Lutz Roeder’s .NET Reflector  – www.aisto.com/roeder/dotnet/

the source it produced(which was very good! i was impressed! good work Lutz!!!), could not be loaded in to visual studio. well it was loadable but i couldn’t open the forms in the GUI editor. there were some errors. there was this manager object which gave a whole lot of errors. it was associated with this tray icon control. i removed all the lines that gave errors until it stoped giving me errors!!! :P lol well after wards the GUI editor could show me the RM UI. and i had to do the same editing/commenting for the other form Memory Reader UI. afterwards i tried to compile it. but hey, it gave some errors. two main errors actually. one was in a switch statement.  it couldn’t accept a float variable as the value on which the switch must happen,

like… switch(num) where num is a float. i tried to find a solution to this. but it seems to trouble sum so i replaced the switch with a nested if.  i think its ok to that.

and then there was a list collection class. and it had a problem referring to it while we are inside a foreach loop! arrr… i tried to find something do about this. but again… i didn’t find anything that could make it work. but the good thing was that this class only helped RM to add a log entry!!! so i commented it out(which makes it unusable of cause… but its just adding a line to the log, nothing bad for the operation of the client… i will have to fix it later or sooner…).

after that RM compiled with no errors. and then i added some tiny features like confirming exit.. different tray icon(of a piggy!!! lol oink! ;) ). and i change the nasty ballon behaviour of the tray icon. it keeps displaying em all the time… so i made it clear to the app to not to show them too often. it will wait 15000 mil secs(15 secs) between two baloons been displayed… nice :)

and then i added a new tab, where i hope to add some stuff. some new features… i have one feature there for now. it will stop updating the tracker. just like when you kill RM(not exit it, cause then it sends the stop event to the tracker). i called this the ‘emulation of a client crash’ feature!!! lol.. hehe.. this could let you make a second choice in case you need to… easily… with out having to kill RM through some process manager(windows task manager)…

hmmm… after a long time i am having fun developing something… lol last time i developed something it was a trojen(which i started from scratch, but i used samples yes! :D )… and now its a ratio cheating program! i guess its getting better lol ;)


Know your ‘enemy’

August 21, 2007

I have been working in my new workplace for about a week now. and as far as i can say this place is very nice. its a small software company with some history. it have a friendly set of coworkers, the polices are fine(except the fact that the working hours are from 9am – 6pm, i would like it to be 8-5 ratehr), there are so many ‘treats’(where people get to eat stuff that will make em fat :P ), the salary is fine. and the location is ok too. so this is pretty much the ideal workplace right… hehe you ask me! well there is something that annoys me a lot. its not about the people there or anything like that. its with the way they do ‘work’;)

for whatever things that they do they use microsoft products for that!!!! oh shit! for everything… they blindly use micorsoft products for everything for every purpose. with out considering alternatives. and this is just sooooo annoying for a linux fan like me!(yeah i admit it i am a fan! and hey whats wrong with it? lol i am happy that i am! but don’t get me wrong i am not a ‘fanboy’ rather i am a fan i really really like the idea of FOSS and open source… wow… its one of the best thing ever!)

And i have to learn all that microsoft stuff… i have to learn dot net and not java :( i have learn sql server and not mysql… oohh… this is bad… but hey i am still learning stuff… and i think i have been away form all this MS stuff for a long time and i have almost forgot how much they suck… :D and now that i am working with em again i feel what i really have in linux… the way they think is very different… i mean it its so different. when u compare the philosophies they are so far away from each other(but kinda da same too in ways… ;) )

So for now i’ll have to learn dot net + MS SQL server + alll the compact stuff… hmmm not bad i will ‘learn’ anyways… and they do pay me for that. and btw i am getting the feeling of a programmer lol! its nice been one… at least the way you start to think of stuff , is very nice… its logical… and kinda cool. u have a problem n a solution kinda view for most of the stuff that meets your eye when u r a programmer… I am also happy that now i am more aware of ‘time’… as i kinda lack it… after the job there is little time left… so i feel how important time is..

i might just be more ‘activated’… just because i have to work with MS stuff… as i don’t feel so happy about it i can always use that ‘urge’ i get to develop something ‘open’… during the midnight ;)

haaa… god i believe in u :)