Jump to content

ms sql and c#

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1
elizabethmwashuma

elizabethmwashuma

    Newbie

  • Members
  • PipPip
  • 29 posts
hi everyone, i am a beginner in ms sql and c#. i have installed sql server 2005 express edition sp2 in my server computer and ms visual 2005 in another computer(client).

i have also created forms in c# and i want to save the data in the server. kindly assist me how i can use the c# forms details to be saved in the sql server databases that i have already created.thanks in advance.

regards,

mwashuma

#2
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
I am not sure, but this might work:
1. Go to View >> Server Explorer
2. Find the server over there and expand it.
3. You will probably find the database there (hopefully)

I never tried this, but in theory this is how it should work.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

#3
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
Ok, in the server explorer right-click "Servers" and add a new server. Try to connect to that server of yours, you know how to authenticate to it.
After you do that, add a new data connection, select "MS SQL Server", press continue and then select the server you want to take it from.

I can not test this since I don't have a server. Please tell me if it works.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

#4
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
Ok, I might break some rules here, but you have a chance of getting this question answered on MSDN forums, there are a lot of MVP's over there that might help you.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

#5
elizabethmwashuma

elizabethmwashuma

    Newbie

  • Members
  • PipPip
  • 29 posts
i have tried to connect using the computer that i had installed vs but it could not connect even after connecting using ip address.
now am trying to install vs into the server computer...wen i have vs installed in the server computer i am sure it will connect but i still need to enable remote computers to access the server

#6
elizabethmwashuma

elizabethmwashuma

    Newbie

  • Members
  • PipPip
  • 29 posts
I have installed vs 2005 into the server computer but stilli cannot seem to find the databases in the server...

#7
elizabethmwashuma

elizabethmwashuma

    Newbie

  • Members
  • PipPip
  • 29 posts
i have managed to open the database in the server through vs 2005 server explorer. thank you very much......the next thing i need to create a table.

say a customer comes in and wants to purchase certain items that are already in the database.how do i ensure that for each item sold, its quantity decreases in the database.

#8
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
You write a Stored procedure for that.
Here is how it works in brief,
When customer places order & check's out the Item[Remember You have to decrease only after a checkout]
Pass the item ID as a parameter to the Stored procedure that decreases the Items.
The Stored procedure will now decrease the Item Number based on Item Id & then Passes the New quantity to the Page to be updated.

#9
elizabethmwashuma

elizabethmwashuma

    Newbie

  • Members
  • PipPip
  • 29 posts
hallo davide..would you kindly assist me with the link to download vs 2010....i want to download it once more.

Regads

#10
ctote

ctote

    Newbie

  • Members
  • Pip
  • 5 posts
This might help: SQL Databases using C# - Connecting and Updating - C#
You can modify the UPDATE sql command with INSERT or whichever command you need - here's a site of SQL commands: SQL Commands - SQL Commands Reference

#11
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts

ctote said:

This might help: SQL Databases using C# - Connecting and Updating - C#
You can modify the UPDATE sql command with INSERT or whichever command you need - here's a site of SQL commands: SQL Commands - SQL Commands Reference
Just start using LINQ, it will make everything easier then with SQL.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics