Jump to content
Xtreme .Net Talk

davesil2

Members
  • Posts

    16
  • Joined

  • Last visited

About davesil2

  • Birthday 08/14/1981

Personal Information

  • Occupation
    Systems Consultant
  • Visual Studio .NET Version
    2003
  • .NET Preferred Language
    Visual Basic

davesil2's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I'm currently working on a program (that is fairly far along) that basically just a file tranfer manager. I have created a web service for the windows client to connect to and send or recieve data (Upload and Download files). My problem is this, my transfer rate does not seem to perform very well. I am sending blocks of bytes (just a byte array like 1024) or some such. I have created a key in the app settings to control outside of code what the block size is. If I am on my computer testing to a web service on my computer it seems to transfer at anywhere between 1500 KB/Sec and 5000 KB/Sec as I would expect but only if I have the byte length set to a high number (at least 300 KB). If I test over the network I'm looking at about 100 to 200 KB with that the same byte lenth. If I do it over the internet (I know you are limited by the slowest common denominator) I can't seem to manage more that 15 KB/Sec and it doesn't matter the byte size I send or recieve. I'm thinking there must be some overhead on the web service that is causing this in addition to figuring out the byte size. How do I know what the appropriate byte size for tranfer is? How can I tell if my web services is "un-efficient" or whatever? Does anyone know how other companies do this (ie. microsoft, adobe, etc.)? Perhaps my problem is that I'm using a web service and or my model is based around the taskvision program that microsoft developed for a demonstration of smart client technology. Any input would be appreciated. -David Silberhorn
  2. I'm trying to pass sections of the byte array at a time with error checking. Right now I have code that I thought would work but appearantly does not. Basically I'm trying to read a file into the stream reader then pick a section of byte to grab from it to pass to something else. I'm basically using something close the the following pseudo code. dim fs as filestream = new filestream("C:\autoexec.bat", FileMode.open) dim ByteFileSection() as byte = new byte(50) {} (I'm not sure what the curly brackets do) fs.read(bytefilesection, startByte, length) I basically do this in a loop and the startbyte increases by 50 every time arround. Perhaps someone has an example or something that I might be able to use. -David Silberhorn
  3. For my own educational purposes, I am writing a program to allow me to upload and download files from a webserver. So far I have the code working the way I want with the uploading. HOwever I'm listing the files in a datagrid with mostly bound columns but one or two template columns. My problem is this. When using a delete button for my event I scan through the datagrid to see if any of the check boxes have been checked. However, wether there is a checkbox checked or not it always comes back false. On the inverse, if I set the checkboxes to always say check it will only come back with true. My thought is that I am running into a bug specifically with Windows 2003 server IIS 6.0 and not a VS .Net 2003 bug because I am following the code from IBuySpy and I cannot install that program on the IIS 6 or when I fudge it together I cannot delete or edit any datagrid items. Could someone please send me something with regards to this? -thanks - David
  4. Hello, I've been programming in VB.Net for the last year. I am currently working with bound objects to a dataset. If I set the datasource of a combobox to a table in my dataset that shows up fine. However, if I create an index changed event for it the data appears to be invalid because my program crashes on loading. This also happens with radio buttons and such. I'm very confused as to why this is happening other than perhaps it is trying to change the index when binding the data where there is no data yet. I created all my own code (except for the form generated code). I use several functions due to re-occurance. the form load looks like this setupDA ' Setup the data adapters and sql commands filldatasets ' fill the dataset will data from the data adapters setbindings ' sets the bindings to the datasets My program doesn't even get to these before it crashes on the indexchanged event for the combobox... Please help :(
  5. Blob, filestream? Check out this code...might be more helpful http://www.xtremedotnettalk.com/showthread.php?t=83808
  6. filestream code 'This opens the filestream to the file Dim fs As FileStream = New FileStream(txtbxFile.Text, fileMode.OpenOrCreate, FileAccess.Read) 'This sets the array size of the byte stream to the size of the file Dim rawdata() As Byte = New Byte(fs.Length) {} 'This writes the file from the filestream to the rawdata fs.Read(rawdata, 0, Convert.ToInt32(fs.Length)) fs.Close() The reverse is applicable as well. The above code will let you read the file off of the client machine and write it to a database or some such. Then you can adapt reverse code to write it to whatever location you wish. I have used this mainly in VB.Net code so you may have to some adapting if you are using asp.net. If you search for blob and filestream on msdn.microsoft.com you can find additional code for more specific information.
  7. Do you have to code to upload the file to the server already? That is where you will need to start. Once you have it uploading the file to the main server you have the hard part setup. The second part is putting it where you want it, you need make sure you have permissions to save the files where you want them...I strongly suggest you not save it to a live location for security puposes. For example you would have code to grab the file from the client computer into a file stream, then you would have to save that file stream from the memory in asp to somewhere on the server (if you want to save to another server you need a unc path or drive mapping like stated above) Let me know if you need code for the file stream part
  8. If I try to Fill a dataset and if I try to update I get an error fatal execption in db. I am using the wizard to I am not trying to do anyting fancy. (ie. Select autoid, name, age from data) Insert does not work when I can get the fill to work. It seems to be getting progressively worse. (Perhaps I'm getting progressively worse...lol) BTW...I'm using SQL MSDE without any problems and have repaired my installation for visual studio .net 2003. In addition. I had several program that I wrote with access in the past but do not appear to be working anymore. The only common link I can find is the updated access engine jet 4.0 sp8. I can't uninstall it either because I did some clean up for space. I may just need to rebuild my computer. -David
  9. I am trying to create a database application. I have had success with foxpro and access databases in the past. I have been trying to create my current app with access and have run into several snags. I am currently just using the VB.Net wizard for the oledataadapter. I can create the adapter and the connection without difficulty. They both appear to work properly in that I can preview the data. However, I am unable to create a dataset that actually works. When I generate the dataset it says there were problems generating the dataset, please build the project, fix any errors, then generate data again. Unfortunately I cannot locate the source of the problem but I have a hinkling that it may be the microsoft jet 4.0 sp8 update that I installed. I haven't been able to remove it so I can't really test. I have tried several different versions of access but that has been unsuccessfull. If anyone knows anything that would be quite helpfull. As of now I have the option of rebuilding my machine and or trying MSDE (though that's not fixing the problem, just working around it). Thanks in Advance - David
  10. I have a program where I have a dataset that I delete certain rows. Once I have call the delete for that row in the loop I try to update it with the data adapter. I have one of two issues. If I simply run da.update(ds, "time") then is says I need a valide delete command for the data adatper. Otherwise if I have a delete command It deletes all of the rows (it's a foxpro database so it doesn't even really delete them which I need help with too. da.fill(ds, "time") ds.tables("time").rows(i).delete del = new oledb.oledbcommand("DELETE FROM 'TIME'", co) ds.update("time").rows(i).delete the above is what I use for the indiviual lines of code but the above code is not complete as far as what I use. I'm guessing I'm just missinig something small and will feel stupid after hearing the answer but I don't know I've spent quite some time researching on MSDN website and google. Just looking for at least a pointer in the right direction. Thanks in advance. -David silberhorn
  11. I am working with a program that does like a shopping cart. I create the item, add it to a database and put that onto the screen to review. I have the table created and the basic format laid out. However, I cannot figure out how to change the location of items at runtime (ie. submit button at the bottom). Is there an easy way to do this? -David Silberhorn
  12. I'm working with foxpro tables to write an asp.net page (same as vb.net for the most part). I am having trouble writing to the foxpro dbf file. I am using the foxpro driver from microsoft and reading works fine. However when I try to "update" information (whether adding a record or updating or deleting) I errors back at me about the cursor. da.update(ds,"time") is the code i'm using da.fill(ds, "time") works fine in the asp and I can pull data out after adding a new row I call the update command and it spits back the cursor error "OleDbException (0x80004005): Cannot update the cursor TIME, since it is read-only" I am using the ole objects to connect and I don't know if that's the problem or what. If someone has any info, please let me know -Thanks David
  13. I'm having a problem with my asp.net code. I have a function call to fill several drop down lists with hours (ie. 12:00AM, 12:15AM, 12:30...). I have it filling correctly and I can get the index to change. However, when the index changes it reloads the form and that resets the indexes since I set the indexes in the fill form code. I want to calculate the time and keep the current indexes when the index is updated. timecard.zip
  14. I figured out what I need to do with my code here is how it works. for saving the file to access/SQL use the following (pseudo code) This is not full code but assumes you have a data connection and know how to access the record in the dataset row public function() dim fs as filestream = filestream("c:\test.jpg", filemode.openorcreate, fileaccess.read) dim rawdata() as byte = new byte(fs.length) {} fs.read(rawdata, 0, convert.toint32(fs.length)) fs.close rwfile("file") = rawdata ' rwfile is the record for the ole object in access end function writing the file back to your system should go as follows (psuedo code) public function writedata() dim mydata() as byte = (file in your dataset) dim k as long = ubound(mydata) dim fs as new filestream("c:\test.jpg", filemode.openorcreate, fileaccess.write) fs.write(mydata, 0, k) fs.close() end function
  15. not quite what I was looking for I don't see how that link helps me. There wasn't any code really and the information was about windows CE sql server and storing a database on that. I am looking to be able to save files (ie. command.com) into a database (SQL server or MS Access) and be able to retrieve from that same database. In MS Access you create and unbound OLE object in the form view, if your in the database you can right click and go to insert and insert a package file. I'm looking for the code in VB .Net to be able to do the same thing you can do in Access (code for SQL server would be good as well, but either one).
×
×
  • Create New...