473,385 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Inserting HashTable Values into Database

I have created a stored procedure for insert

CREATE PROCEDURE dbo.insert_sample(@Name varchar(50),@Age char(4),@City varchar(50))
AS
INSERT dbo.Test1 VALUES(@Name,@Age,@City)

I want to create an HashTable, and insert Hashtable values to table......

waiting for answers
Feb 25 '08 #1
3 1713
Plater
7,872 Expert 4TB
I would think a DataTable object would be better suited then a hashtable, but you're free to use whatever you want.
Have you gone through this:
http://www.thescripts.com/forum/thread635615.html
Feb 25 '08 #2
I have been alloted an assignment, it goes as :

1.Place 3 textboxes,for name, city & age

2.Create an Class.cs, in that declare property to get & set values.
3.Create instance of Class.cs in code behind and assign the textbox values to it.
4.And insert the values in database using the instance from another class.cs (where i will place my insert command)

I have finished the above 4.......Next

5.create stored procedure and then create an hashtable, and concatenate the "Keyname" with i/p parameters inside an loop.....

Can help me out for 5th point.......i know about Connection string and how to use it.......
Feb 25 '08 #3
Plater
7,872 Expert 4TB
We're not supposed to do assignments.
But I guess it sounds like for every record you are going to be inserting, read off the values from the hashtable (which seems silly since you can only get one record out of that nicely) and execute your stored procedure with those values.
Feb 25 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: pmud | last post by:
I have an ASP.NET web application using C# code. I am trying to insert values from a web form into an SQL database. I am using SQL COMMAND object for this. I need to know HOW TO INSERT THE RADIO...
2
by: mark4asp | last post by:
Hello, I am converting an app from JavaScript to ASP.NET I have the following JavaScript 'associative array'. Is there a concise way to create an analogous structure in .NET Framework using...
8
by: SenthilVel | last post by:
how to get the corresponding values for a given Key in hashtable ??
16
by: Sreekanth | last post by:
Hello, Is there any better collection than HashTable in terms of performance, when the type of the key is integer? Regards, Sreekanth.
2
by: altergothen | last post by:
Hi there I am a newbie to ASP.Net - Please Help! I am trying to insert the values of my variables into a database. If I try the following it works perfectly: string insertQuery = "INSERT into...
8
by: Robin Tucker | last post by:
When I create a hashtable hashing on Object-->Item, can I mix "string" and "integer" as the key types? I have a single thumbnail cache for a database with (hashed on key) and a file view (hashed...
6
by: Bunty | last post by:
I want to insert values in the database.If i insert values one by one then it works till 4 or 5 fields then after it gives error.In my database there are more than 20 field.Pls help me.
2
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
1
by: ntabb | last post by:
Hello All, I have a hashtable of nodes that need to be added to a tree. The hash table's values contain an object that holds the node's Level, Index, and Text. The table keys names of the node. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.