User Profile

Collapse

Profile Sidebar

Collapse
porfirion
porfirion
Last Activity: Dec 7 '08, 11:32 AM
Joined: Oct 26 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • porfirion
    started a topic 'generics' + linq = ?
    in .NET

    'generics' + linq = ?

    hello everyone :)
    I have a simple question

    Code:
    DataClasses1DataContext db = new DataClasses1DataContext(conn);
    var tab = new TABLE_in_DB();
    now, is there a way to asigne a value to the one of the columns/variables without knowing its name ?

    normaly you would asign a value like that:
    Code:
    tab.Var = "some value";
    but is there a way of doing this more like:
    Code:
    tab["columnNameString"]
    ...
    See more | Go to post
    Last edited by porfirion; Dec 5 '08, 05:47 PM. Reason: .

  • porfirion
    replied to Create User cmd problem
    Ok I've did some research and came up with an answer to my problem:


    Code:
    CREATE PROCEDURE test
    AS
    DECLARE @s nvarchar(20)
    SET @s = 'jeden dwatrzy'
    EXEC sp_adduser test2 ,@s


    or with the usage of the transaction
    Code:
    CREATE PROCEDURE test
    AS
    BEGIN transaction
    DECLARE @s nvarchar(100)
    declare @a nvarchar(30)
    SET @a = '[jakis nowy]'
    ...
    See more | Go to post

    Leave a comment:


  • porfirion
    replied to Create User cmd problem
    I've already tried with the " but it did not work either :(

    If it's no problem to create that kind of user, using wizard from the context menu on the DB>Security>Use rs>New user ... - there should be some way of doing the same thing from the code level
    See more | Go to post

    Leave a comment:


  • porfirion
    started a topic Create User cmd problem

    Create User cmd problem

    Hi,
    I'm writing c# app and I want to add a new login and user to a SS 2005 DB using Stored Procedure.
    I've come with the folowing code:



    can someone tell me how can I create a new user with a space between first and a last name ?...
    See more | Go to post
No activity results to display
Show More
Working...