Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #31 (permalink)  
Old July 18th, 2011, 06:04 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Why do you keep posting the same code over and over again?

Quote:
what is the method that i can delete the particular selected records
Did you follow the three steps I mentioned above?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #32 (permalink)  
Old July 18th, 2011, 06:40 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default to update in gridview

hey thanks dr i did all the procedures to said now its working can u just tell me how can i update the checkbox list and the textbox by using the same datakeys how can my checkbox list will get update if there are around 5 to 6 checkbox in a list
please help me out
  #33 (permalink)  
Old July 18th, 2011, 07:40 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default not able to update gridview

Protected Sub GridviewOdin_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridviewOdin.RowUpdating
Try
Dim Service_ID As String
Service_ID = GridviewOdin.DataKeys(e.RowIndex).Value.ToString
myconnection.ConnectionString = sqlConStr
mycommand = New SqlCommand("sp_ServiceUpdt", myconnection)
myconnection.Open()
mycommand.CommandType = CommandType.StoredProcedure
mycommand.Parameters.Add("@Service_ID", SqlDbType.Int).Value = Convert.ToInt32(Service_ID)
mycommand.Parameters.Add("@Service_Name", SqlDbType.NChar, 100).Value = txtServiceName.Text
mycommand.Parameters.Add("@NSE", SqlDbType.Bit).Value = Convert.ToBoolean(chkExchange.SelectedItem.Value.T oString)
mycommand.Parameters.Add("@BSE", SqlDbType.Bit).Value = Convert.ToBoolean(chkExchange.SelectedItem.Value.T oString)
mycommand.Parameters.Add("@NSE_FO", SqlDbType.Bit).Value = Convert.ToBoolean(chkExchange.SelectedItem.Value.T oString)
mycommand.Parameters.Add("@MCX", SqlDbType.Bit).Value = Convert.ToBoolean(chkExchange.SelectedItem.Value.T oString)
mycommand.Parameters.Add("@MCX_SX", SqlDbType.Bit).Value = Convert.ToBoolean(chkExchange.SelectedItem.Value.T oString)
mycommand.Parameters.Add("@NCDEX", SqlDbType.Bit).Value = Convert.ToBoolean(chkExchange.SelectedItem.Value.T oString)
mycommand.Parameters.Add("@NSE_SX", SqlDbType.Bit).Value = Convert.ToBoolean(chkExchange.SelectedItem.Value.T oString)
mycommand.Parameters.Add("@Manager_1", SqlDbType.Bit).Value = Convert.ToBoolean(chkServer.SelectedItem.Value.ToS tring)
mycommand.Parameters.Add("@Manager_2", SqlDbType.Bit).Value = Convert.ToBoolean(chkServer.SelectedItem.Value.ToS tring)
mycommand.Parameters.Add("@MIS_101", SqlDbType.Bit).Value = Convert.ToBoolean(chkServer.SelectedItem.Value.ToS tring)
mycommand.Parameters.Add("@MIS_102", SqlDbType.Bit).Value = Convert.ToBoolean(chkServer.SelectedItem.Value.ToS tring)


mycommand.ExecuteReader()

myconnection.Close()
GridviewOdin.EditIndex = -1
Bindgrid()

Catch ex As Exception
Response.Write(ex.Message)
End Try
End Submy stored procedure is as follows--
CREATE PROCEDURE sp_ServiceUpdt
@Service_ID int,
@Service_Name nchar(100),
@NSE bit,
@BSE bit,
@NSE_FO bit,
@MCX bit,
@MCX_SX bit,
@NCDEX bit,
@NSE_SX bit,
@Manager_1 bit,
@Manager_2 bit,
@MIS_101 bit,
@MIS_102 bit
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
update tbl_Service
set
Service_Name =@Service_Name,
NSE = @NSE,
BSE = @BSE,
NSE_FO =@NSE_FO,
MCX= @MCX,
MCX_SX = @MCX_SX,
NCDEX = @NCDEX,
NSE_SX = @NSE_SX,
Manager_1 = @Manager_1,
Manager_2= @Manager_2,
MIS_101=@MIS_101,
MIS_102=@MIS_102
where Service_ID = @Service_ID

select * from tbl_Service
end
i am getting a error that String was not recognized as a valid Boolean.

Last edited by priti2010; July 18th, 2011 at 09:14 AM..
  #34 (permalink)  
Old July 18th, 2011, 10:49 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I am sorry, but I don't think I can help you anymore. I realy tried hard, but asking the same questions over and over and over and over and over again (post relevant code, provide a clear problem description, tell us what the debugger tells you, tell us where the code crashes, post the relevant code, explain what you're doing, post the relevant code) gets boring after a while.

Sorry it didn't work out.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #35 (permalink)  
Old July 20th, 2011, 04:43 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default how can i avoid duplicate records to get add or update in a table

how can i make a stored procedure to check the duplicate records present or not while inserting and updating records
  #36 (permalink)  
Old July 20th, 2011, 08:28 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

CREATE PROCEDURE sp_ServiceRcds
-- Add the parameters for the stored procedure here
(@Service_Name nchar(100),
@Otputs nchar(50) output)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @result nchar(50)
IF EXISTS (select * from tbl_Service where Service_Name = @Service_Name)
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET @result = 'Records Already exits'
END
ELSE
BEGIN
INSERT into tbl_Service(Service_Name) values(@Service_Name)
-- Insert statements for procedure here
SET @result ='Records Added'
END
END
this is my stored procedure now how can i co-relate with the other insert procedure and update procedure to avoid duplicacy of records
  #37 (permalink)  
Old July 21st, 2011, 12:47 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default duplicates records

how can i call the procedure to check the duplicate records present in table while adding or updating the table
  #38 (permalink)  
Old August 2nd, 2011, 04:52 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default to avoid duplicate records

can any one tell me how can i avoid duplicate records not to save in gridview and if match is found show error of duplicates record found
  #39 (permalink)  
Old August 5th, 2011, 03:07 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check Duplicate Record while adding new records

to check duplicate record while entering new record

Dim myconnection as New SqlConnection
Dim str As String = "SELECT COUNT(*) FROM <tablename> WHERE LTRIM(RTRIM(parameter))='" & textbox1.Text.Trim & "'"
mycommand = New SqlCommand(str, myconnection)
Dim mCount As Integer = mycommand.ExecuteScalar()

If mCount = 0 Then
write insert query
else
Label1.text= "Duplicate match"
end if
  #40 (permalink)  
Old August 10th, 2011, 07:37 AM
Authorized User
Points: 63, Level: 1
Points: 63, Level: 1 Points: 63, Level: 1 Points: 63, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default error while updating same records

Dim str As String
str = String.Empty
Dim Service_Name As String
Dim colindex As Integer = 1
Service_Name = DirectCast(GridviewOdin.Rows(e.RowIndex).FindContr ol("Service_Name"), TextBox).Text
str = "SELECT COUNT(*) FROM tbl_Service WHERE LTRIM(RTRIM(Service_Name))='" & Service_Name & "'"
mycommand = New SqlCommand(str, myconnection)
Dim mCount As Integer = mycommand.ExecuteScalar()
'myconnection.Close()

If mCount = 0 Then
update procedure
else
MsgBox("Duplicate Service Found", MsgBoxStyle.OkOnly, "")
end if
This above is my query i cant update the grid with the same record present in the grid but if i update new records it will check and update but existing records cannot be update in the same row
how can i solve this error
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass value to stored procedure? hertendreef SQL Server 2005 3 February 23rd, 2007 11:43 AM
How to pass a parameter to a stored procedure? MaxGay2 VB.NET 2002/2003 Basics 1 November 8th, 2006 02:48 PM
stored procedure with parameters Danmalam VB Databases Basics 0 February 27th, 2005 03:52 PM
How will I pass stored procedure in an asp shoakat SQL Server 2000 1 July 15th, 2004 10:28 PM
SQL Pass though parameters to stored procedures blinton25 SQL Server 2000 3 March 29th, 2004 02:49 PM



All times are GMT -4. The time now is 01:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.