473,657 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regarding DALC Creation using stored procedures

11 New Member
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 1510
Delerna
1,134 Recognized Expert Top Contributor
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
kanimozhiz
11 New Member
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.Configur ation;
using System.Collecti ons.Specialized ;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
public class student
{
public student()
{

StudentTableAda pters.studentTa bleAdapter stu = new StudentTableAda pters.studentTa bleAdapter();
Student.student DataTable 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.studen tDataTable'. 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 Recognized Expert Specialist
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
1532
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 the Reference table. A reference is unimportant outside the context of its document. When displaying the document, I need to display all of its references and when updating the document, I need to update its references. Is it appropriate to place...
3
8541
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 from my J2EE background and was trying to figure out if this is just Microsoft just giving a new name to an old pattern or if it's something I should be looking into instead of DAO. Thanks, Leo
2
2813
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 code in stored procedures (im advocating encryption of them). When deploying an application however stored procedure seem to add another level of complexity to installation. In future we also plan to have an basic ASP app with some of the...
2
9218
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 problems doing this. I wanted to implemented a generic "Helper" class like this: /** * Helper
0
2229
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 (calls) and bubble up (events); each object knows about the object to its right. The domain model is responsible for loading and saving itself, which it delegates to a DALC. The domain model's load and
0
2642
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 to call them from an ASP.Net page Every modern database system has a stored procedure language. SQL Server is no different and has a relatively sophisticated and easy to use system. This article will not attempt to go into depth in explaining...
3
1840
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 = _ "CREATE PROCEDURE GetID" & vbCrLf & _ "@ID int out," & vbCrLf & _ "@Name varchar(20)" & vbCrLf & _ "AS" & vbCrLf & _
4
1359
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 copy of the jar, the old copy is still being referenced.
1
1465
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. Can anyone plz help me how to do this. Reply me as soon as possible its very urgent. Regards, kani.Z
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7352
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.