15,891,951 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 RmcbainTheThird (Top 52 by date)
RmcbainTheThird
1-Mar-21 13:00pm
View
One other thing, do not use int.Parse() it will throw an exception if the text is not a number. Use tryParse() instead
RmcbainTheThird
7-May-20 13:30pm
View
that snippet will not even compile. You are returning values before declaring it,you mark your get as a string and yet when you do declare it you declare it as an array.
RmcbainTheThird
30-Apr-20 13:15pm
View
I don't want to be a 'get off my lawn' kinda guy, but have you thought about buying a book and using that to learn how to write software?
RmcbainTheThird
26-Feb-20 9:33am
View
ok you need to find the column in the datagrid that has the auto increment field, get that value and pass it to the method that does the delete
RmcbainTheThird
25-Feb-20 15:26pm
View
When you wrote your query to get the data to populate your datagridview did it contain the column that holds the auto incremment value?
RmcbainTheThird
11-Sep-19 9:53am
View
Deleted
what is the range on years ie. starting with and ending with
RmcbainTheThird
3-Sep-19 8:00am
View
EI 11
RmcbainTheThird
30-Aug-19 9:32am
View
Tried it both checked and unchecked, no deal still can't debug using IE
RmcbainTheThird
26-Aug-19 14:54pm
View
ms access sql
RmcbainTheThird
19-Aug-19 8:24am
View
Well it was unchecked. so I checked it and then unchecked and now F5 works... whow knows?
RmcbainTheThird
29-Jul-19 8:12am
View
Can you show the markup for the label? For example on one of my aspx pages I have a label defined as <asp:label id="lblGreeting" runat="server"> and in the code behind I can assign a value thusly: lblGreeting.Text = prefName + "!";
RmcbainTheThird
12-Jun-19 8:51am
View
Have you written the all the rows back to the db? Did you refresh your dt collection? inquring minds want to know
RmcbainTheThird
11-Jun-19 7:44am
View
So when you run that query raw in the db what do you get back?(pet peeve #1 about linq)
RmcbainTheThird
10-Jun-19 7:49am
View
It may be required but what is the justification? What will changing the property names accomplish? What problem will it solve?
RmcbainTheThird
15-May-19 12:56pm
View
Oops gotta learn to read gooder
RmcbainTheThird
11-Apr-19 13:51pm
View
same result. and I do have a breakpoint set on the first line of code
RmcbainTheThird
1-Apr-19 14:40pm
View
So what are the inputs valid or invalid and how are they used? What do they have to do with the sql query?
RmcbainTheThird
15-Mar-19 8:53am
View
How are you dealing with the problem of two different people working on their local copy of the file at more or less the same time? Who ever saves first is going to lose their changes when the other person saves their copy.
RmcbainTheThird
7-Mar-19 14:53pm
View
why aren't you setting textBox4.Text = parts[1]?. also there is a real strong assumption that the project name does not have spaces in it. Is that true? If so how do you know that is the case?
RmcbainTheThird
27-Feb-19 8:59am
View
What type of security are you using? If it is integrated then it may be the user using the app does not have rights to the db.
RmcbainTheThird
26-Feb-19 7:46am
View
Solution three will not even compile
RmcbainTheThird
12-Feb-19 7:44am
View
Don't know myself but Google told me about this
https://code.visualstudio.com/docs/editor/tasks#_custom-tasks
RmcbainTheThird
11-Feb-19 8:51am
View
Yes that would have been nice but I assume that anyone who has managed to find this site must be able to use google..or am I being to optimistic :)
RmcbainTheThird
11-Feb-19 7:51am
View
By constant string do you mean:
private const string PARENT = "parent";
RmcbainTheThird
8-Feb-19 8:05am
View
Not at all I agree that sorting is expensive and in retrospect the for loops is a better solution. I have stopped worrying about cpu cycles and running out of memory since I left c some 20 years ago and got on the .net bandwagon. Makes a man lazy.
RmcbainTheThird
7-Feb-19 11:26am
View
If you don't sort then that means you are going to have to use a for loop twice, once to find the largest number and then a second time to find the next largest.
RmcbainTheThird
31-Jan-19 10:23am
View
Why are you marking the transaction object as shared?
RmcbainTheThird
30-Jan-19 7:43am
View
along with sample data a schema would help
RmcbainTheThird
29-Jan-19 7:57am
View
Let's see your schema and your insertion code
RmcbainTheThird
23-Jan-19 14:38pm
View
Let me see if I understand this. somewhere in windows you have copied something to the clipboard. in your application you want whatever you have in the clipboard to appear in the textboxes. and you want this to happen when.....?
RmcbainTheThird
16-Jan-19 15:59pm
View
ok here is an example from one of my projects. I am going to assume that MySQL and sqlserver have similar layouts
public bool UpdateInfoCenter(InfoCenterParent icData)
{
bool retVal = true;
string sqlStr = "UPDATE [dbo].[InfoCenterParent]"
+ " SET[ListOrder] = @ListOrder"
+ ",[DisplayText] = @DisplayText"
+ ",[Description] = @Description"
+ ",[ImageFile] = @ImageFile"
+ ",[ChildDisplayOrder] = @ChildDisplayOrder"
+ ",[LastUpdatedBy] = @LastUpdatedBy"
+ " WHERE ID = @icID";
List<sqlparameter> parameters = new List<sqlparameter>
{
new SqlParameter {ParameterName = "@icID", SqlDbType = SqlDbType.Int, Value = icData.ID},
new SqlParameter {ParameterName = "@ListOrder", SqlDbType = SqlDbType.Int, Value = icData.ListOrder},
new SqlParameter {ParameterName = "@DisplayText", SqlDbType = SqlDbType.VarChar,Value = icData.DisplayText},
new SqlParameter {ParameterName = "@Description", SqlDbType = SqlDbType.VarChar,Value = icData.Description},
new SqlParameter {ParameterName = "@ImageFile", SqlDbType = SqlDbType.VarChar,Value = icData.ImageFile},
new SqlParameter {ParameterName = "@ChildDisplayOrder",SqlDbType = SqlDbType.VarChar,Value = icData.ChildDisplayOrder},
new SqlParameter {ParameterName = "@LastUpdatedBy", SqlDbType = SqlDbType.VarChar,Value = icData.LastUpdatedBy}
};
try
{
retVal = true;
DataAccess.ExecuteSQL(_connStr, sqlStr, parameters);
}
catch (Exception ex)
{
retVal = false;
FrameworkLogger.Error("Failed to upadte infocenter parent", null, ex);
}
return retVal;
}
this is the method DataAccess.ExecuteSql:
public static void ExecuteSQL(string connStr, string sqlStr, List<sqlparameter> parameters = null)
{
try
{
//using (new Impersonator("ZS9ADAU", "Corp", pword))
{
using (SqlConnection conn = new SqlConnection(connStr))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sqlStr, conn);
if (parameters != null)
{
cmd.Parameters.AddRange(parameters.ToArray());
}
cmd.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
FrameworkLogger.Error("Failed to execute sql staement ", null, ex);
throw ;
}
}
RmcbainTheThird
16-Jan-19 14:54pm
View
In that case you will need to look at what they type in and if it is a number then your where clause will be [Product Code]=@d1 and if they type in text the where clause be [Product Name] = @d1. You will need to use the same logic to decide how to declare your parameter. But you will not have a where clause with an OR in it.
RmcbainTheThird
14-Jan-19 7:59am
View
Are you talking about logging into the application or logging into windows? Are you asking about logging for one application or all applications the user may be using?
RmcbainTheThird
8-Jan-19 8:20am
View
Where is the Excel file located?
RmcbainTheThird
2-Jan-19 7:36am
View
Can you show us the markup for the label?
RmcbainTheThird
21-Dec-18 9:09am
View
Sounds like the traveling salesmen problem but with trains
RmcbainTheThird
19-Dec-18 13:54pm
View
Does your db tables include as lastUpdated and a UpdatedBy column ? If so then this work would be better done by a scheduled job that scans your db for updated records and send out emails
RmcbainTheThird
19-Dec-18 9:47am
View
Well the rebinding works but I was never able to get a value that would allow me to identify the one gridview I was editing in and rebind that one. I ended up having to rebind ALL the nested gridviews. I am going to stick a fork in it and call it done
RmcbainTheThird
15-Dec-18 6:56am
View
True the row does not have an ID but it does have columns and what I need to do is get the value of one of those columns when adding a child row We have a one to many relationship between the data in the parent/top gridview and the child/nested gridview. When the parent row has one or more child records(the nested gridview) and I want to add addition rows/records I can get the value of the column that defines that relationship by getting the value of gvBulletItems.DataKeys[0].Value. gvBulletItems being the child gridview and the sender parm on the RowComandEvent. However if there are no rows in the childgridview then for whatever reason gvBulletItems.DataKeys[0] is null. I need to get the data stored in one of the columns (the unique ID)of parent row that defines the relationship between the parent gridview and the new row I am adding to the child gridview.
RmcbainTheThird
12-Dec-18 13:54pm
View
yes I am. is that an oopsie :)
RmcbainTheThird
12-Dec-18 13:54pm
View
yes, that is how I am grabbing the value
RmcbainTheThird
11-Dec-18 8:07am
View
thank you Vincent. This works My big mistake was assuming that the OnRowDataBound event was only called once( the Row part of the event name should have been a hint :) )
RmcbainTheThird
16-Nov-18 15:03pm
View
In the snippet I provided what is the value of cnt when the loop is exited?
RmcbainTheThird
1-Nov-18 12:07pm
View
Yes that was the issue. For what ever reason I had inserted a validatorcalloutextender in my page that was not needed. but I was so focused on the popup thing Ihad my blinders on.
RmcbainTheThird
11-Oct-18 14:11pm
View
There is no javascript in the app.
RmcbainTheThird
17-Aug-18 14:37pm
View
Well double checked both thoughts all good. and besides while trying to get this to work I added an event to the code behind to do the same thing and no problem there finding the divs( have I mentioned that I hate javascript)
for (int idx = 1; idx <= 7; ++idx)
{
HtmlControl div = cp.FindControl(divName + idx) as HtmlControl;
Button btn = (Button) cp.FindControl(btnName + idx);
if (idx != id)
{
btn.CssClass = "tabdiy button";
div.Visible = false;
}
else
{
btn.CssClass = "tabdiyactive";
div.Visible = true;
}
}
RmcbainTheThird
15-Aug-18 14:15pm
View
Yes I have and the GetelementbyID always returns a null even though I can see the name of the element in the developer tools and it matches what is in the javascript method
RmcbainTheThird
9-Aug-18 11:08am
View
The code is executed on a button click so everything is rendered before the method is executed
<asp:Button class="tabdiy tablink tabwidth" CommandArgument="2" OnClientClick="openLink(event, 'Tab2')" ID="btnDIY2" runat="server">
RmcbainTheThird
9-Aug-18 10:21am
View
I have looked at the rendered code and the id matches what I am building in the javascript. and the Ids I am building in the javascript match the rendered html. most aggravating
RmcbainTheThird
17-Jul-18 16:14pm
View
And indeed it was programmer error :) found in the head of my aspx file: <base target="_blank"/>
RmcbainTheThird
12-Jul-18 10:39am
View
That is what I thought as well. It is all in the code behind ... no ajax no JS of any kind
protected void MenuClick(object sender, System.EventArgs e)
{
Button clickedButton = (Button) sender;
//Response.Redirect(clickedButton.CommandArgument,true);
// WebUtilities.OpenSameWindow(clickedButton.CommandArgument);
//Server.Transfer(clickedButton.CommandArgument);
}
public static void OpenSameWindow(string url)
{
string cmd = @"window.open('{0}','_self',false);";
System.Web.HttpContext.Current.Response.Write(string.Format(cmd, url));
}
RmcbainTheThird
24-May-18 11:49am
View
Sorry no, I spend enough time writing my own code and am not willing to do yours for free. If you are unsure how to get a connection string from your config file, open a database, query the database, build an insert query with the data from the first query then you need to pick up a book or hit Google to understand and utilize these concepts.
Show More