16,016,425 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11357862 (Top 31 by date)
Member 11357862
6-Jul-15 5:11am
View
I have tried this code in asp.net grid view row databound event.
double tot=0;
if (e.Row.RowType == DataControlRowType.DataRow)
{
total = total + Convert.ToDouble(GridView1.Rows[1].Cells[6].Text);
GridView1.Rows[1].Cells[7].Text = total.ToString();
}
but it shows error.
Member 11357862
6-Jul-15 2:57am
View
I have tried lag function, but its not working in sqlserver 2008
Member 11357862
6-Jul-15 1:57am
View
Yes, I need to add the balance column like I shown in the example table 2
Member 11357862
26-Jan-15 1:28am
View
Sir could u pls explain
Member 11357862
20-Jan-15 3:49am
View
Let me tell the detail of my program.This page include searching of my product details which are in database. when I type product name on textbox then corresponding details will be displayed in gridview.eg: If I type 'c' then camera,cot etc will come on gridview and I type 'ca' then camera will come on grid view. This is done by keyup function and the gridview is in update panel. So each time the update panel only update.
When I use the default button then the update panel will not work and the all page will update. so how can I solve this.
Member 11357862
20-Jan-15 3:44am
View
I have used the above code but its not working
Member 11357862
20-Jan-15 0:18am
View
thank u Jeet
Member 11357862
19-Jan-15 6:46am
View
I hv used the code, but it shows error her
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.SelectedRow;
TextBox3.Text = row.Cells[1].Text;
TextBox4.Text = row.Cells[2].Text;
TextBox5.Text = row.Cells[3].Text;
}
protected void Button2_Click(object sender, EventArgs e)
{
GridView1_SelectedIndexChanged(sender, e)
}
error:null reference exception was unhandled by user code
shows this error on TextBox3.Text = row.Cells[1].Text;
Member 11357862
19-Jan-15 5:52am
View
protected void Button2_Click(object sender, EventArgs e)
{
TextBox3.Text = GridView1.Rows[HiddenField1.Value].Cells[1].Text;
TextBox4.Text = GridView1.Rows[HiddenField1.Value].Cells[2].Text;
TextBox5.Text = GridView1.Rows[HiddenField1.Value].Cells[3].Text;
TextBox6.Text = GridView1.Rows[HiddenField1.Value].Cells[4].Text;
}
I have added this on button1, but it shows error. How can I declare the hidden field value?
Member 11357862
19-Jan-15 5:22am
View
no its outside the gridview,
I need to add the selected indexchanged event on this button. If I click on the submit button(btn1) then this code want to execute
GridViewRow row = GridView1.SelectedRow;
TextBox3.Text = row.Cells[1].Text;
TextBox4.Text = row.Cells[2].Text;
TextBox5.Text = row.Cells[3].Text;
Member 11357862
19-Jan-15 4:17am
View
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.IO;
using System.Collections.Generic;
public partial class Default4 : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data source = VISHNUIT;Initial Catalog = sims1; Integrated security= True");
SqlCommand cmd = new SqlCommand();
SqlDataReader dr;
DataTable dt = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
Body.Attributes["bgcolor"] = "apple green";
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.SelectedRow;
TextBox3.Text = row.Cells[1].Text;
TextBox4.Text = row.Cells[2].Text;
TextBox5.Text = row.Cells[3].Text;
}
protected void TextBox3_TextChanged(object sender, EventArgs e)
{
String str = "select * from login where (uname like + @search + '%' )";
SqlCommand xp = new SqlCommand(str,con);
xp.Parameters.Add("@search", SqlDbType.VarChar).Value = TextBox3.Text;
con.Open();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = xp;
DataSet ds = new DataSet();
da.Fill(ds, "uname");
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
Here button1 is my submit button.
Member 11357862
18-Jan-15 10:09am
View
alter TABLE Mycode12 alter column adescrip nvarchar(max) COLLATE Arabic_BIN
I have used this query, now it shows as ßÑÓì ÍãÇã ÈÚÌáÇÊ
Member 11357862
18-Jan-15 9:54am
View
I have added nvarchar, but can't view the Arabic data. In my column already have Arabic script. but it shows as ?CE. cannot able to view it. For inserting new data in Arabic format I can add it by N' Arabic script'. Its working. But I already have some datas in database in Arabic scripts. Can't able to view it.
Member 11357862
17-Jan-15 4:05am
View
thank u sir for ur great help
Member 11357862
17-Jan-15 3:19am
View
Sir I hve executed the statement but it shows this error.
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.
Member 11357862
13-Jan-15 9:11am
View
sir I checked my whole pgm, I think that it is due to the convertion error. The image will insert to the code like 110,111 etc. But image will not insert into the code like 110-1,D110-1 etc. How can I resolve this
Member 11357862
12-Jan-15 3:35am
View
could u pls explain
Member 11357862
11-Jan-15 10:21am
View
No, my current coding is updating, but only for 22 rows remaining not.
Member 11357862
11-Jan-15 10:21am
View
No, my current coding is updating, but only for 22 rows remaining not.
Member 11357862
11-Jan-15 9:43am
View
no, its on my system
Member 11357862
11-Jan-15 9:18am
View
img is my image column in database. in this column I want to insert the images. the path of image is this 'D:\images.
Member 11357862
11-Jan-15 9:05am
View
DECLARE @CODE nvarchar(50)
DECLARE image_cursor CURSOR FOR
SELECT CODE FROM MyMast WHERE img IS NULL
OPEN image_cursor;
FETCH NEXT FROM image_cursor
INTO @CODE;
WHILE @@FETCH_STATUS = 1
BEGIN
DECLARE @sql NVARCHAR(MAX)
DECLARE @imagePath NVARCHAR(255)
SET @imagePath = 'D:\images\'+ RTRIM(LTRIM('@CODE')) + '.jpg'
SET @sql = 'UPDATE MyMast '
SET @sql = @sql + 'SET img = (SELECT BulkColumn FROM OPENROWSET( BULK ''' + @imagePath + ''', Single_Blob) AS img) '
SET @sql = @sql + 'WHERE CODE = ''' + (@CODE) +''';';
BEGIN TRY
EXECUTE sp_executesql @sql
END TRY
BEGIN CATCH
END CATCH
FETCH NEXT FROM image_cursor
INTO @CODE;
END
CLOSE image_cursor;
DEALLOCATE image_cursor;
SELECT CODE, img FROM MyMast WHERE img IS NOT NULL
Member 11357862
7-Jan-15 11:33am
View
sir, thank u for ur great help, but still it is updating only 22 rows.I my D:\images folder there is images in the name 110-1.jpg,110-2.jpg etc. In my sql table there is the product code 110-2,110-1 etc.
Member 11357862
7-Jan-15 11:22am
View
ya done, I think the problem is in any other parts, still hv same issue, is there any code available to insert this image in asp.net using c#?
Member 11357862
7-Jan-15 11:03am
View
DECLARE @CODE varchar(20)
DECLARE image_cursor CURSOR FOR
SELECT CODE FROM MyMast WHERE img IS NULL
OPEN image_cursor;
FETCH NEXT FROM image_cursor
INTO @CODE;
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @sql NVARCHAR(MAX)
DECLARE @imagePath VARCHAR(255)
SET @imagePath = 'D:\images\' + RTRIM(LTRIM(@CODE)) + '.jpg'
SET @sql = 'UPDATE MyMast'
SET @sql = @sql + 'SET img = (SELECT BulkColumn FROM OPENROWSET( BULK ''' + @imagePath + ''', Single_Blob) AS Picture), PictureFileName = ''' + @imagepath + ''' ';
SET @sql = @sql + 'WHERE CODE = ''' + @CODE + ''';'
BEGIN TRY
PRINT @sql
END TRY
BEGIN CATCH
END CATCH
FETCH NEXT FROM image_cursor
INTO @CODE;
END
CLOSE image_cursor;
DEALLOCATE image_cursor;
SELECT CODE, img FROM MyMast WHERE img IS NOT NULL
Member 11357862
7-Jan-15 11:02am
View
sir I have done this query correction, but its not updating the remaining coloumns.
Member 11357862
7-Jan-15 10:47am
View
I have changed @sql nvarchar(max) and the code to SET @sql = @sql + 'SET img = (SELECT BulkColumn FROM OPENROWSET( BULK ''' +' @imagePath' + ''', Single_Blob) AS Picture),PictureFileName = ' + '@imagepath' but same pblm
Member 11357862
7-Jan-15 10:24am
View
ya I hv given space, but it doesn't resolved issue, can u pls give me any other code for inserting multiple images?
Member 11357862
7-Jan-15 9:54am
View
ya I have removed the set before the picture file name. I didn't get the details abt string concatenation
Member 11357862
7-Jan-15 9:52am
View
I didn't get u
Member 11357862
7-Jan-15 9:41am
View
sir till now my issue is not reolved
Show More