15,905,414 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 Python 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 martyres72 (Top 33 by date)
martyres72
11-Aug-16 14:19pm
View
it works perfectly. Thank you for the help.
martyres72
11-Aug-16 14:14pm
View
I added working code as the solution. See any issues?
martyres72
11-Aug-16 14:13pm
View
I made some small changes, and is working now. I am using the "foreach". is that bad practice?
martyres72
11-Aug-16 14:02pm
View
good to know. I guess I'll keep looking.
martyres72
11-Aug-16 14:01pm
View
I've even tried wrapping the code behind in this:
foreach (GridViewRow row in GridView2.Rows)
It gets further, but then throws exception for some other problem
martyres72
11-Aug-16 13:59pm
View
well I guess this not necessarily true, because I'm getting the value in textbox on different event.
martyres72
11-Aug-16 13:55pm
View
https://jsfiddle.net/3nwdcoL9/
martyres72
11-Aug-16 13:54pm
View
I'm good on the value, and I'm setting a textbox value w/ it to be sure.
martyres72
11-Aug-16 13:50pm
View
so essentially, my gridview is databound, and column 1 contains value that I want to dictate the NavigateURL
martyres72
11-Aug-16 13:48pm
View
yes.
martyres72
11-Aug-16 13:47pm
View
my code isn't pasting in right. Here is markup for the hyperlink I am trying to update:
<asp:TemplateField HeaderText="aaaa">
<itemtemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='~/bogus.aspx'>Contact
martyres72
11-Aug-16 13:46pm
View
Deleted
not all of my code copied in. Here is the section from gridview, containing the hyperlink I am trying to update:
<asp:TemplateField HeaderText="aaaa">
<itemtemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='~/bogus.aspx'>Contact
martyres72
11-Aug-16 13:40pm
View
Deleted
updated the question with markup and code.
martyres72
11-Aug-16 13:33pm
View
the code behind is not updating the NavigateURL.
martyres72
5-May-16 10:30am
View
Excellent info. Thanks for putting me on track.
martyres72
5-May-16 9:46am
View
thanks for the quick response. I haven't used a stringbuilder......can you add a small example of code, while I research.
martyres72
24-Feb-16 12:38pm
View
System.Web.UI.DataVisualization.Charting.Chart Chart1
martyres72
24-Feb-16 10:04am
View
I solved the parameter issue. Current problem is how to bind the values to the pie chart correctly. See updated code.
martyres72
24-Feb-16 10:04am
View
I solved the parameter issue. Current problem is how to bind the values to the pie chart correctly. See updated code.
martyres72
24-Feb-16 9:55am
View
I believe I have multiple issues. My first issue is how to bind 4 values to the pie chart that equate to a total of 100. Secondly, I could use some direction in declaring and passing the parameter into the query. The querystring is being passed in from the previous page.
martyres72
24-Feb-16 9:55am
View
I believe I have multiple issues. My first issue is how to bind 4 values to the pie chart that equate to a total of 100. Secondly, I could use some direction in declaring and passing the parameter into the query. The querystring is being passed in from the previous page.
martyres72
16-Feb-16 18:15pm
View
Working like a charm now. Thanks for your help, Rich.
martyres72
16-Feb-16 16:54pm
View
thank you. Found it, fixed it, and have new error. syntax issue
Line 24: conn.Open();
Line 25: SqlCommand cmd = new SqlCommand("select image from solids where sampleid=" + ImageID, conn);
Line 26: SqlDataReader dr = cmd.ExecuteReader();
Line 27: dr.Read();
Line 28: context.Response.BinaryWrite((Byte[])dr[0]);
martyres72
16-Feb-16 15:14pm
View
Not exactly sure what that means, but I'll look further at this. I'm fairly new to writing code, and your help is appreciated.
martyres72
16-Feb-16 14:46pm
View
file is in same path. I did try handler, and received a parser error. Parser Error Message: Could not create type 'ADAuth.ImageHandler'.
martyres72
16-Feb-16 14:22pm
View
I agree to the control names suggestion. Any thoughts as to why my image is not displayed?
martyres72
16-Feb-16 14:12pm
View
I believe you are right. Below is code to save to db.
protected void Button1_Click(object sender, EventArgs e)
{
Byte[] bytes = null;
if (FileUpload1.HasFile)
{
string filename = FileUpload1.PostedFile.FileName;
string filePath = Path.GetFileName(filename);
Stream fs = FileUpload1.PostedFile.InputStream;
BinaryReader br = new BinaryReader(fs);
bytes = br.ReadBytes((Int32)fs.Length);
}
string insertCmd = "INSERT INTO Solids VALUES (@CustomerID,@WellID,@TestDate,@SampleDate,@LabID,@SampleLoc,@Appearance,@Weight,@WeightwSample,@PostXylene,@AceticWash,@WaterWash,@HclWash,@SampleWeight,@PercentHydro,@PercentIron,@PercentCarb,@PercentSalts,@PercentAcid,@Comments,@sulfides,@createdby,@createddate,@image)";
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["AMTConnectionString"].ConnectionString))
{
conn.Open();
SqlCommand myCommand = new SqlCommand(insertCmd, conn);
.
.
.
.
.
.
.
myCommand.Parameters.AddWithValue("@image",SqlDbType.Binary).Value = bytes;
martyres72
16-Feb-16 14:09pm
View
Deleted
I believe you are right, but I'm not sure where changes needed. code below to save to db.
protected void Button1_Click(object sender, EventArgs e)
{
Byte[] bytes = null;
if (FileUpload1.HasFile)
{
string filename = FileUpload1.PostedFile.FileName;
string filePath = Path.GetFileName(filename);
Stream fs = FileUpload1.PostedFile.InputStream;
BinaryReader br = new BinaryReader(fs);
bytes = br.ReadBytes((Int32)fs.Length);
}
string insertCmd = "INSERT INTO Solids VALUES (@CustomerID,@WellID,@TestDate,@SampleDate,@LabID,@SampleLoc,@Appearance,@Weight,@WeightwSample,@PostXylene,@AceticWash,@WaterWash,@HclWash,@SampleWeight,@PercentHydro,@PercentIron,@PercentCarb,@PercentSalts,@PercentAcid,@Comments,@sulfides,@createdby,@createddate,@image)";
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["AMTConnectionString"].ConnectionString))
{
conn.Open();
SqlCommand myCommand = new SqlCommand(insertCmd, conn);
// Create parameters for the SqlCommand object
// initialize with input-form field values
myCommand.Parameters.AddWithValue("@CustomerID", TextBox2.Text);
myCommand.Parameters.AddWithValue("@WellID", TextBox3.Text);
myCommand.Parameters.AddWithValue("@TestDate", TestDate.Text);
myCommand.Parameters.AddWithValue("@SampleDate", SampleDate.Text);
myCommand.Parameters.AddWithValue("@LabID", TextBox16.Text);
myCommand.Parameters.AddWithValue("@SampleLoc", TextBox14.Text);
myCommand.Parameters.AddWithValue("@Appearance", TextBox5.Text);
myCommand.Parameters.AddWithValue("@Weight", TextBox6.Text);
myCommand.Parameters.AddWithValue("@WeightwSample", TextBox7.Text);
myCommand.Parameters.AddWithValue("@PostXylene", TextBox1.Text);
myCommand.Parameters.AddWithValue("@AceticWash", TextBox13.Text);
//myCommand.Parameters.AddWithValue("@WaterWash", TextBox8.Text);
if (!string.IsNullOrEmpty(TextBox8.Text))
{
myCommand.Parameters.AddWithValue("@WaterWash", TextBox8.Text);
}
else
{
myCommand.Parameters.AddWithValue("@WaterWash", 0);
}
myCommand.Parameters.AddWithValue("@HclWash", TextBox17.Text);
myCommand.Parameters.AddWithValue("@SampleWeight", TextBox17.Text);//computed value; any initial value will do; sql table trigger computes real value
myCommand.Parameters.AddWithValue("@PercentHydro", TextBox8.Text);//computed value; any initial value will do; sql table trigger computes real value
myCommand.Parameters.AddWithValue("@PercentIron", TextBox8.Text);//computed value; any initial value will do; sql table trigger computes real value
myCommand.Parameters.AddWithValue("@PercentCarb", TextBox8.Text);//computed value; any initial value will do; sql table trigger computes real value
myCommand.Parameters.AddWithValue("@PercentSalts", TextBox8.Text);//computed value; any initial value will do; sql table trigger computes real value
myCommand.Parameters.AddWithValue("@PercentAcid", TextBox8.Text);//computed value; any initial value will do; sql table trigger computes real value
myCommand.Parameters.AddWithValue("@Comments", TextBox15.Text);
myCommand.Parameters.AddWithValue("@Sulfides", DropDownList1.Text);
myCommand.P
martyres72
16-Feb-16 13:55pm
View
code added
martyres72
16-Feb-16 13:54pm
View
code added
martyres72
16-Feb-16 13:54pm
View
code added
martyres72
16-Feb-16 13:54pm
View
code added
martyres72
16-Feb-16 13:18pm
View
Deleted
code added.
Show More