|
Brillaint! thank you so much
|
|
|
|
|
I'm desiging a form that has related information from several tables: parts, manufacturing methods, jobs, raw material, customer po's, etc. To minimize network traffic, I start with a dataset populated with part numbers and another dataset populated with a table of part processes (i.e. a part may have processA, process B, etc.)
Should I use one main dataset to store all the different tables generated by different stored procedures as well as one main SqlDataAdapter to communicate between sql database and windows form? If I do, then when pushing changes back to database via adapter, won't I have to re-set the "select", "update", and "delete" commands for the adapter based on the appropriate table when updating?
The alternative is to have several adapters for the form with their own specific "select" statements, initialized one time, and ready to be used whenever a change is pushed.
Does this sound correct and if so, which is the preferred design method?
Thanks in advance!
John
|
|
|
|
|
The most efficient and maintainable method would be to have a DataSet that represents all the 'related' tables required for your form. This DataSet should contain all the tables and each table should have a relationship between Primary and Foreign keys. You then need a DataAdapter for each table in your DataSet. When you close the form, clear the tables and DataSet.
Alternatively, you can have have a main DataSet that represents your entire database and extend it (add tables and relations) as you open each form. You can then clear all tables and the DataSet when you close the application. This is difficult to maintain and the least efficient since it consumes more resources on the client.
With either method, you could re-use one global DataSet object as required.
I usually create another DataSet to hold any temporary tables required.
Steve
|
|
|
|
|
Thanks Steve. Your "most efficient" method is what I was thinking, but wasn't quite sure about the DataAdapters. Your suggestion makes perfect sense.
|
|
|
|
|
i have two text files namely test1.txt and test2.txt
by using DTS how can we transform dynamically
Regards
Dayakar D.N
|
|
|
|
|
How can i use the project(Windows Application) made by vb.net(use Ado.Net) depend on SQL Server2000 in client pc without install SQL Server2000 in the client pc?
In other words I want ask if there is any way in which we will not install SQL Server2000 on client pc and the program will run properly?
|
|
|
|
|
FriendlySoluations wrote: In other words I want ask if there is any way in which we will not install SQL Server2000 on client pc and the program will run properly?
So long as there is a network path to the SQL Server that you want to use you can run the client application anywhere. SQL Server is designed to run as a central server with many client processes using it across a network.
|
|
|
|
|
I'm not sure if I understand your question correctly, but have you heard of the Micrsofoft SQL Desktop Engine (MSDE)?
Steve
|
|
|
|
|
Dear friends,
I want to traverse the metadata information of a database. For example, i've a database and i want to list all the user tables in that databse. Also, for each table, i want to list all the columns of the table. Similarly, for each column, i want to determine whether it is a primary key or a foreign key. I also want to determine constraints information.
What is the best method to do so in .NET ?
Imtiaz
|
|
|
|
|
--1fst sp
CREATE PROCEDURE Ks_Ins_Media_Item
@Desc nvarchar(200),
@added_date datetime,
@Added_by nvarchar(100),
@item int output
As
insert into Ks_Media_Item ([Description],Added_Date,Added_By)
values(@Desc,@added_date,@Added_by)
set @item = @@identity
============================
--2sd sp
CREATE PROCEDURE Ks_Ins_Media_Item_content
@Item_No int,
@content ntext,
@textlength int
As
insert into Ks_Media_Item_content(Item_no,content,text_length)
values(@item_no,@content,@textlength)
========================================
--3rd sp
CREATE procedure ks_media_item_full_data
@Desc nvarchar(200),
@added_date datetime,
@Added_by nvarchar(100),
@content ntext,
@textlength int
as
declare @ItemNo int
execute dbo.Ks_Ins_Media_Item @item output,@Desc, @added_date, @Added_by
execute dbo.Ks_Ins_Media_Item_content @ItemNo output,@content, @textlength
===================================
can you help me
i want to pass yhe output parameter to 3rd sp
becuse 1st the Item_no is identity yes
and in 2sd sp identity false
how can i do it
pls
|
|
|
|
|
CREATE PROCEDURE Ks_Ins_Media_Item
@Desc nvarchar(200),
@added_date datetime,
@Added_by nvarchar(100),
@item int output
As
insert into Ks_Media_Item ([Description],Added_Date,Added_By)
values(@Desc,@added_date,@Added_by)
set @item = @@identity
CREATE PROCEDURE Ks_Ins_Media_Item_content
@Item_No int,
@content ntext,
@textlength int
As
insert into Ks_Media_Item_content(Item_no,content,text_length)
values(@item_no,@content,@textlength)
CREATE procedure ks_media_item_full_data
@Desc nvarchar(200),
@added_date datetime,
@Added_by nvarchar(100),
@content ntext,
@textlength int
as
declare @ItemNo int
execute dbo.Ks_Ins_Media_Item @Desc, @added_date, @Added_by, @ItemNo output
execute dbo.Ks_Ins_Media_Item_content @ItemNo,@content, @textlength
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
i have procedure with output parametr
i have to pass it to another procedure
in execution what is the syntax of it
pls
|
|
|
|
|
procedure1(procedure2(proc2Param))
|
|
|
|
|
it's cannat run can i pass the code to you yo see
the error
thank you
|
|
|
|
|
Paste ur code here and we will solve problem
|
|
|
|
|
Hi,
I need to modify a MS Access database:
- Rename tables
- Rename columns
- Add new columns and set field properties
(Can't seem to set "Allow Zero Length" with Access SQL)
I'm finding that SQL for Access is sometimes lacking when I need to update the database as my application grows. I see from my on-line research that some people turn to DAO or ADOX. If I'm working with an Access db, which should I use and why?
PS - Why would MS Access have a field property "Allow Zero Length" but no SQL statement to set/change it?
thanks,
Ron
|
|
|
|
|
First of all, only Text, Memo and Hyperlink fields can accept zero length strings and therefore have that property.
You may want to look into using DDL to manage your table properties.
Steve
|
|
|
|
|
Thanks Steve,
I knew that only Text, Memo and Hyperlink fields only have that property, but as far as my research, I can't use SQL to change this property... if there is, please let me know.
Thanks for the tip on DDL, I'll do some research.
Ron
|
|
|
|
|
I always do such edits in Access. I have never tried to alter table structures dynamically from VB.
You may want to try posting your question in MDBMakers.com.
This forum has Access MVP's and many knowledgeable users who may be able to help you.
Steve
|
|
|
|
|
hi,
i'm working on mysql database i want to select from table last 10 rows inserted where id=5
Always Thx for you help
Regards,
Charbel Asmar
|
|
|
|
|
SELECT * from mytable where id=5 order by orderbyfield <code>LIMIT 10</code>
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I'm using VC++ 6.0, and using the ODBC API to connect to the databse.
My question is that is there a way to find the limit of the number of fields permitted per Primary Key.
Eg. For MS SQL 2000/ 2005 limit is 16 or less fields for a primary key.
For MS Access the limit is 10 or less fields for a primary key.
|
|
|
|
|
Try SQLGetInfo(SQL_MAX_COLUMNS_IN_INDEX).
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi guys;
I have this problem with sql server 2000 and asp.net 2.0
Here is the problem:
I am trying to use the Roles.AddUserToRole(string username ,string Role) .
Now the problem starts when the program gets to this place where it has to execute the addusertorole method. Im getting this error:
Error 446: cannot resolve collation conflict for equal to operation
I have read alot and searched the internet but I dont quit get what am I suppose to do.
Could you please help me to resolve this problem?
Thanks a million
Hadi
|
|
|
|
|
Hi ;
Thanks alot for the reply from minhpc_bk was very usefull. Right on time.
Here is how i fixed the problem:
I replaced the line in aspnet_UsersInRoles_AddUsersToRoles stored procedure
DECLARE @tbNames table(Name nvarchar(256) NOT NULL PRIMARY KEY)
with
DECLARE @tbNames table(Name nvarchar(256) COLLATE Database_Default NOT NULL PRIMARY KEY)
Riazi
|
|
|
|