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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
D

Drathmar

@Drathmar
About
Posts
18
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WPF Listbox
    D Drathmar

    Well it came up because we have a list box inside a listbox. I was trying to make it so that when the user presses a letter "a,b,c,d,e,f... etc" it would select that given listbox subitem. Instead it move to the next question. So this is happening in the key down event and I need to handle it there? Or is there a better way of doing it?

    WPF question wpf csharp wcf

  • WPF Listbox
    D Drathmar

    I recently started the WPF and I came across a weird behavior in listboxes. I have it binding to a viewmodel object and displaying the view properly, even have it selecting the item properly. Sometimes those listbox have text boxes for my user to type in, and when they hit the F key, it moves to the next listbox item. After alot of digging I found out that it has to do with the name space of the item bound to the listbox. If I change the viewmodels class to "zsomename.folder.viewmodel" then when I type z in the text box it moves it to the next listbox item. Its like there's a built in behavior to select a matching listbox item base off the starting letter... but how do I remove this, or what is calling this. Anyone have any ideas?

    WPF question wpf csharp wcf

  • Finding a Keybinding
    D Drathmar

    I have a WPF that I'm trying to track down a problem to. Basically when I have a list box and the user hits the "F" key it moves "currentselection" to the next listbox item in the list box. (this is really bad when you have a use trying to type into a textbox and they use the letter "F" and it moves to the next listboxitem) I'm looked at the InputManager and a few other classes but I'm not exactly sure how to figure out what is happening to change the selected item. Anyone know of a good way of tracking this down?

    WPF question csharp wpf help tutorial

  • Using Strongly typed Datasets and a Data Access Layer
    D Drathmar

    I've built some strongly typed data sets, they work pretty good, but they didn't do everything I wanted them to do. So I make a class Library and called it my DAL(Data access layer) in it, I had the data adapters, and would do some processing and then make some calls to the db through the functions set in the strongly typed datasets. The whole system seems to be working pretty good, but now I have someone else working with me on the page stuff. At first he created his own instance of the data adapters and bypassed my DAL. Does anyone know a good way of preventing the DAL from being bypassed? I don't know if there's a way to change the scope of a strongly typed data set so that only one class could access it. Kris

    Database database question

  • private Table Adapters
    D Drathmar

    Lately I have be using Strongly typed datasets and adapters and have been liking them. However I have come across a few stumbling blocks that I was wondering if someone could help me with. 1. I'm making a code library that does various things, I guess you would call it something of a 'business layer.' I have strongly typed data adapters, with my own sql fuctions. In my library I use these data adapters and also enforce a few key rules like setting timestamps and logging user names. If someone could create their own instance of the data adapter and bypass my library it would threaten the integrity of the data. Is there some way to secure the dataset so that my libary would be the only thing that could create it? 2. Next thing, in my library each function creates a data adapter, calls its function or functions and then returns its value. Since it is a class I was looking at making a private static version of each of these data adapters. Are there any pitfalls that I should be aware of, (adapters not clearing data, or disconnecting, etc....) or is this a pretty common practice? 3. Lastly, is there some way to enforce rules into the data adapter itself. For instance if i have a function called "Add_Record(recorddata, username, timestamp)" do something to enfoce that username must always be "HttpContext.Current.User.Identity.Name" and that the timestamp is "datetime.now"

    Database database business help question announcement

  • Updating many rows with ADO.net
    D Drathmar

    Right now I have a program that queries a database and saves the data into a a strongly typed dataset Then I perform various calculations on each record and fill in 5 null fields with data Lastly, I click upload and it does a for loop, for each data row and calls the update method to update the database with the calculated values. This works all fine and dandy, except the upload part is rather slow. it looks something like DataAdapter.StoredProcedureUpdate(Primary key, NewValue1, NewValue2, NewValue3, NewValue4, NewValue5) I'm guessing that the upload part is slow because its repeating a process where 3/4 of the work done is not the update function 1. creating the connection 2. connecting and authnicating 3. calling the update procedure 4. closing the connection I'm still somewhat new to ADO.NET so I'm not quite sure if its actually doing this. Does anyone have some good suggestions on a better method? Perhaps a way to call a bulk update through ADO.net or SQL?

    Database database csharp question announcement

  • the DetailsView
    D Drathmar

    thank you for your previous help from before I've been using a detailsview, an object data sources, with a data access layer, and a stored procedure, and my back to a problem with E.values. What i'm trying to do is, after I insert a new event, I want to get the the key of the newly inserted event and set that key as my current key for the details view. I've been playing with the parameter output, I know that i'm setting EventsKey to the newly added record. I tried to catch it in "OnItemInserted" but when I output all the values from e.values, the new key isn't part of that list. I don't know where the output parameter would be stored, or if there's a better way to get this new key value back to the business layer. Drathmar Here's my code: **Object Data source** **data access layer function** public static Boolean EventsAdd(string UserKey, string EventTitle, string EventDescription, DateTime EventDate, out string Eventkey) { SqlConnection con = new SqlConnection(connectionString); SqlCommand cmd = new SqlCommand("EventsAdd", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@UserKey", SqlDbType.Int, 4)); cmd.Parameters["@UserKey"].Value = UserKey; cmd.Parameters.Add(new SqlParameter("@EventTitle", SqlDbType.VarChar, 20)); cmd.Parameters["@EventTitle"].Value = EventTitle; cmd.Parameters.Add(new SqlParameter("@EventDescription", SqlDbType

    ASP.NET help question

  • MultiView vs panels
    D Drathmar

    For a while now, I've simply used panels, and made them visible=true/false to change the view. However I started playing with the multi view and it seems to have them same functionality and well only one seems to be able to be active at a time. When I was reading about a multi view and read that it loads all controls reguardless of active view. (maybe I misunderstood this part) In my current setup I have: If i have a multi view with three views, or a page with 3 panels. The views would have a gridview, listview, and a details view, and same with the panels. Now due to the nature of these views, I have been using 3 different object sources, one for each. So now comes my question: If I do a multi view, does that mean that every time the page is reloaded, that it will requery the DBF for each of the views? since they are all in existance? (thus, 3 database queries per page load?) What about if a panel that contains a gridview that is not visible. I think that the object is not even sent to the client, and I'd assume that it would not even be created, and thus no object query made. Is that a safe assumption? Lastly, does anyone know a good way to track/count database queries made every time a page is loaded? Maybe a code snip or a log file that could be checked? Drathmar

    ASP.NET database question visual-studio workspace

  • Locking a screening
    D Drathmar

    When you say to leave it to Group Policy? I don't exactly follow, how would you do this with "Group Policy"?

    C# question

  • Locking a screening
    D Drathmar

    A client recently asked me if I could make a porgram that would have a fairly simple functionality, but with a catch. When the program is running he wants it to be the only program available. So a user couldn't alt tab and go to another program or minimize the program and open up a web broswer. To get out might require the user to hit escape and type in a password. I call it "Locking" but maybe there's already a phrase for this type of functionality. Is there? Drathmar

    C# question

  • Removing Image options
    D Drathmar

    I was fairly sure that images could not be 100% protected. How ever, if there are some good ways to make it difficult to strip an image from a page. So that the average user would atleast have a hard time doing stripping the image, I'd be happy. Drathmar

    ASP.NET php tutorial

  • the DetailsView
    D Drathmar

    I'm using a details view for the first time. I have a data access layer in my program so I'd like to avoid using the SQLDataSource Object if I can. I've been trying to do an insert with the details view. On my details view I have OnItemInserting="DetailsViewSubmit_Insert" in my code section I have a function: protected void DetailsViewSubmit_Insert(Object sender, DetailsViewInsertEventArgs e) From what I'm reading the information the user typed into the text boxes is supposed to be an an Idictionary object at "e.Values" However when I check e.Values.count its always empty. Has someone else come across this problem, or perhaps is there a better way to use the details view? Here's the full details view. protected void DetailsViewSubmit_Insert(Object sender, DetailsViewInsertEventArgs e) { Response.Write("DetailsViewSubmit called - count = " + e.Values.Count); }

    ASP.NET help question

  • Removing Image options
    D Drathmar

    I'm trying to build a website for a client. He represents several artists and wants to display their art on the web. One of the key features he wants is so that a user can't download any picture they want (whether by right clicking and doing a save as or what ever) I've seen an implementation on PHP that uses a "OnRightClick" and overrides the browers normal functions. How ever there were still a few ways to get around that. I was wondering if anyone had some good ideas or suggestions on how to do this. Drathmar Drathmar

    ASP.NET php tutorial

  • Programmically Adding Controls
    D Drathmar

    My problem in a nutshell is the programmatically created controls aren't working 100% of the time. NOTE: Giving the Programmically made controls an id fixed the problem, and thank you minhpc_bk for the help. However I made some sample code to demonstrate the problem, what's cause the problem, is still abit puzzling, To replicate the problem: When the page first loaded the hidden value is blank, then I click on ButtonR1 or R2 to make it red. So on and so on. Now, if you start clicking on the buttons in the "Panel Created" panel, they don't work 100% of the time. You have to click the same button twice in a row for it to work. Drathmar Here is a simplified example of my problem. *****************HTML************** <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> Untitled Page

    ***************** Code ************** using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using S

    ASP.NET html sysadmin json help tutorial

  • Programmically Adding Controls
    D Drathmar

    I've come across this odd behavior, that I'm not quite sure what to make of it, or even how to determine the source of the problem. Ok, I have one page. 3 different buttons on that page. asp:Panel ID="PanelNew" runat="server" Width="97%" > asp:button runat="server" text="MostRecent" OnCommand="SelectActiveView" CommandArgument="MostRecent" CommandName="Hide" /> asp:button runat="server" text="Most Recent 2" id="testbutton" /> /asp:Panel> Then I had code in the page load that is: testbutton.Command += new CommandEventHandler(this.SelectActiveView); testbutton.CommandArgument = "MostRecent"; testbutton.CommandName = "Hide"; Button TempButton = new Button(); TempButton.Text = "Cancel"; TempButton.Command += new CommandEventHandler(this.SelectActiveView); TempButton.CommandArgument = "MostRecent"; TempButton.CommandName = "Hide"; PanelNew.Controls.Add(TempButton); So, I have on that's declared in html, one that's declared in html then modified from code, then the last is complete code made, all three buttons end up having the same command arguements, but the one made from code behaves differently from the rest. The function they call, modifies some hiden value fields then calls a page load. Ok, now this part, is hard to explain, so please stay with me. If I go straight to that page from a link, all three buttons work, first try. If I click on a button that does a post back on to the page, then I click on the tempbutton, the hidden field values are not updated, Then I click the same button a second time and it does update the hidden values like it was supposed to on the first click. Well, I hope that made sense. If it didn't then post that and I'll see if i can post some source code to duplicate this behavior. Drathmar

    ASP.NET html sysadmin json help tutorial

  • asp:button MouseOver
    D Drathmar

    Could you give me an example on the syntax to add a mouse over event to a button in a skin file? The only way I know how to do this is code file for a given page.

    ASP.NET tutorial java css hardware question

  • asp:button MouseOver
    D Drathmar

    I'm having problems finding the best way to set the mouse over attribute for several buttons. right now I do something like : btnClear.Attributes.Add('onMouseOut', 'setStyleOff(this.id)); and I do this in the page load for each button, a mouse over and a mouse out event However this can get quite tedious when you want all your buttons to have the same effect and some of them are embedded in datalists or grids. Is it possible to set the mouse over/out event in a skin file or a CSS style sheet so that it will run the same java function for EVERY button on a page? If so, could someone give an example of how to do this? Kris

    ASP.NET tutorial java css hardware question

  • To many SQL Data Sources?
    D Drathmar

    I'm still pretty new to the Asp.Net world. I have a website that a user will have to fill out some forms. Several of these forms I want the entries to be standardized into drop down boxes. (for intstance, ethnicity) I'd like to be able to pull values from an 'ethnicty' table and well several other tables for other drop down boxes. How ever I have a concern, how many sqldatasource objects is to many? (Is it common practice to use as many as 10 different sql data sources on the same webpage?) How well does the .net code optimize these data sources? For example, on each datasource does it open a connection, run the query then close connection for all 10 sources? In general, if I ran the queries on page load and then set the values of the drop down boxes would/could that be more efficient? Or are there a better places than page_load to do that?? Any info on these questions would be greatly appreciated, thanks Drathmar

    Database database csharp asp-net tutorial question
  • Login

  • Don't have an account? Register

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