473,399 Members | 4,192 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,399 software developers and data experts.

Regarding DALC Creation using stored procedures

Hi
I have created the DAL component using stored procedures but I am unable to insert,update and delete the records in the Database.

But retrieve is done as a whole and unable to retrieve a particular record using the Id.
May 21 '08 #1
3 1497
Delerna
1,134 Expert 1GB
Hi
I have created the DAL component using stored procedures but I am unable to insert,update and delete the records in the Database.

But retrieve is done as a whole and unable to retrieve a particular record using the Id.
Sorry but this is too generic.
Some code and a better description of the problem you are having would be helpful.
May 21 '08 #2
Sorry but this is too generic.
Some code and a better description of the problem you are having would be helpful.

I am using the front end as VS .net2005, the language is C#
the back end is SQL server2005.

I have created the Stored procedures in sql and I want to access those SPs through DAL component.
For that I have added the dataset in C# website project, in that I have added the table from DB and connecting the DB by configuring the methods in the TableAdapter.

I am able to retrieve the data from the table but unable to insert,update or delete the data from the table using the option "Use existing stored procedure" while configure the methods in the TableAdapter.

Then I am adding one class file. class1.cs in that I wrote the code that is given below...
using System;
using System.Data;
using System.Configuration;
using System.Collections.Specialized;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public class student
{
public student()
{

StudentTableAdapters.studentTableAdapter stu = new StudentTableAdapters.studentTableAdapter();
Student.studentDataTable s1;
s1 = stu.InsertQuery();


}
}

but when I right click on the insert method in the table adapter->preview data
I got an error as "Object reference not set to an instance of an object" for that purpose only I am adding the above code to instantiate the object.

but still I am getting the error like this "Cannot implicitly convert type 'object' to 'Student.studentDataTable'. An explicit conversion exists (are you missing a cast?)"

plz help as soon as possible. Its very urgent....
Thanks in advance

Regards,
kani.Z
May 21 '08 #3
ck9663
2,878 Expert 2GB
Have you tried posting this on the C# forum? They might be able to help your better as this is more of C# question that an sql-server question.

-- CK
May 21 '08 #4

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

Similar topics

1
by: jacobryce | last post by:
I'm new to using .net and data access logic components and I'm getting a bit confused on the best way to design the data layer. I have a table called Document that has a 1 to many relationship with...
3
by: Leo | last post by:
I'll make it brief: are DALC (Data Access Layer Components) and DAO (Data Access Objects) the same thing? They appear to be from what I've read on MSDN. I'm quite familiar with the DAO pattern...
2
by: scott | last post by:
Hi, Just wondering what sort of problems and advantages people have found using stored procedures. I have an app developed in VB6 & VB.NET and our developers are starting to re-write some of the...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
0
by: David Veeneman | last post by:
What is the better way to connect a DALC component and a domain model; an interface, or an event? I'm creating an application that looks like this: --> --> --> o- Messages drill down...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
3
by: Wie | last post by:
I need help. How do I create a stored procedure with SQLCommand? I have tried following string, but it doesn't work. I am using vs.net 2003 professional now. dbCommand.CommandText = _...
4
by: annhere | last post by:
Hi, Could any one please shed some light as to how an jar whose copy has been deleted from the SQLLIB\FUNCTIONs\JAR\<schema> still be referred to from our projects? Even after installing a fresh...
1
by: kanimozhiz | last post by:
Hi Can anyone tell me how to invoke the DALC(Data Access Logic Component) class using stored procedures in C# .net I have created the DALC using stored procedure but I was unable to execute it....
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.