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
I

ibmkahm

@ibmkahm
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Linq to Entities: check existence of a record in a database before inserting a new record
    I ibmkahm

    thanks a lot for the answer but i'm still stuck. The entitykey is set (TagID)in my Entity Model, just like the Primarykey in the Database. Besides TagID (PK) the tag table has only one more column: tagName. So when i insert a tag that already exists (for exc. tag.tagName = tag1) the database just inserts another tag1. I tried to add a unique contraint to the tagName column, then i get an exception when trying to insert another tag1. I'm not sure what you mean with "disconnected objects", so i will just describe my procect a little more: in my web app there is a form where users can submit products (and add for exc. tags to it), when the user clicks a submit button the product information are saved (with the help of the Entity Framework) in the database. "Tag t = Tags.FirstOrDefault(e =>; e.ID == x)" is to check if there is already a certain record (tag) in the database ?

    LINQ question csharp database linq performance

  • Linq to Entities: check existence of a record in a database before inserting a new record
    I ibmkahm

    In my web app a user can assign muliple tags to products. There are three tables: products, tags and products_tags to implement a many to many relationship. My question is, how would you implement this with the Entity Framework (LINQ to Entities): "Insert only a new tag in the tags table if it doesnt already exist there, dont add if it exists". So before the insert i have to check first if a tag exists, whats the best way to accomplish this (best performance) ?? (Btw. The Tags table consists of TagID (PK) and TagName) thanks for answers

    LINQ question csharp database linq performance

  • Questions about ASPNETDB.MDF
    I ibmkahm

    hello everybody, in my web site i have two databases, ASPNETDB.MDF and a self created one (database.mdf). (The don't contain a lot of data yet) But i need a relationship (foreign key) between a table in ASPNETDB.MDF and a table in database.mdf. So i guess i need to merge both databases first, would you just extend the "ASPNETDB.MDF" with the tables from "database.mdf" ? or better configure "database.mdf" for the asp.net Applicatoin Services and then delete "ASPNETDB.MDF" ? Is "ASPNETDB.MDF" even meant to be used in a production online web application? (Right now i'm using sql server express but i will probably use sql server when deploying Site to a shared host) thanks a lot for answers

    ASP.NET database csharp asp-net sql-server sysadmin

  • How to load an image, then wait a few seconds, then play a mp3 sound ?
    I ibmkahm

    thank you a lot for the answer !!!! it works now :-)

    Windows Forms help tutorial question

  • How to load an image, then wait a few seconds, then play a mp3 sound ?
    I ibmkahm

    Hello everybody, (after pressing a button) i would like to show an image (using a picturebox), wait a few seconds and then play a mp3 sound, but i dont get it to work. To wait a few seconds i use "System.Threading.Thread.Sleep(5000)". The problem is, the image alway appears AFTER the wait time, but i want it to show first, then wait, then play the mp3... i tried to use "WaitOnLoad = true" but it doesnt work, shouldn't it load the image first and the continue to read the next code line ?? Here is the code i've tried, that doesnt work: private void button1_Click(object sender, EventArgs e) { pictureBox1.WaitOnLoad = true; pictureBox1.Load("image.jpg"); System.Threading.Thread.Sleep(5000); MessageBox.Show("test"); //just to test, here should be the code to play the mp3 } (i also tried loading the image with "LoadAsync" and put the code to wait and play the mp3 in the "LoadCompleted" event, but that doesnt work either...) would be very nice if somebody helps me

    Windows Forms help 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