Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

JonB

@JonB
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Memory utilization of MemoryStream
    J JonB

    I assume you're looking at the process size when you hit the ReadKey(). Your ObjMemoryStream will be 1GB + 1 byte big (you start from 0). Then you evaluate ObjMemoryStream.ToArray(). That will create an array (Help: "This method returns a copy of the contents of the MemoryStream as a byte array"), also of size 1GB-odd. (You don't know when .NET will garbage-collect that, and process sizes often don't shrink anyway.) Don't convert your memory stream to an array! Try something like ObjMemoryStream.CopyTo() instead.

    .NET (Core and Framework) performance tutorial question

  • DetailsView question
    J JonB

    I developed originally with VS 2003. There I was happy using DataSet with DataAdapters, and the old DataGrid control. For "detail view" of selected item in DataGrid, I rolled my own viewer. Now I am revisiting and attempting to get "up-to-date" with the new TableAdapters, GridView & DetailsView. I had assumed that DetailsView would be tied to GridView and could show just the selected item's details. I see it actually displays (one of) many items, which I don't really want/need, but never mind. Now, my adapters fill a dataset, and that is what I have bound the GridView to (via its DataSource). I do *not* want it to issue a SQL command directly. Still less do I want the DetailsView to issue its own SQL command, I want it to work off the filled DataSet. That rules out the examples way, which allows binding to a *parameter* taken from the selected item in the GridView and passing that as an argument to a SQL command. My problems/questions/work-arounds are as follows: 1. I can bind a DetailsView DataSource to same DataSet/DataTable, but can find *no* means of setting which item/row is selected in the DetailsView. All its "selected" stuff seems to be read-only (whereas I can select in a GridView). Am I missing something? 2. Although I wouldn't mind DetailsView navigation between rows, I only *need* it to show the selected row. If I have to go down this route: 2a. I could create a copied table with just one row in it, but that seems ugly, and it only contains a *copy* of the row anyway. 2b. I can use a DataView to select one row and bind the DetailsView to that. But I don't see the DataView being used much any more. 2c. I could create a "Business Object" to do this, and look into its "SelectCommand" (or whatever). My searches have revealed nothing. Don't understand why this isn't a common requirement. Please let me know if I have missed something for #1, or which way from #2 I should be pursuing? Thanks.

    ASP.NET question css database visual-studio wpf

  • Executing SQL scripts from file
    J JonB

    (Beginner to SQL/MSSQL). I have created some SQL scripts (e.g. for repopulating tables for test), and saved them to external file (e.g. repopulating tables). I want to get SQL server to execute the scripts. I do *not* want to use an interactive utility (e.g. Query Analyzer, though that's where I generated and saved the scripts), nor a command-line utility (e.g. osql, though it does precisely what I'm trying to do). I do not want to store them as stored procs in a db. I want to do it from code (actually C# & ASP.NET application, though that shouldn't matter). The files are accessible to the SQL server. What I want is a SQL statement like: EXEC <file-path> but I can't find anything like this. Yes, I could write code to open the file and append all the text to a string I finally submit to an ExecuteNonQuery(), but this seems brain-damaged to me (is this in fact what osql does?). *Surely* there's something for this? TIA

    Database database csharp sql-server asp-net sysadmin
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups