15,913,722 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 Derek Kennard (Top 14 by date)
Derek Kennard
4-Apr-16 0:18am
View
A few minor tweaks, but the concept was exactly what I needed. Thank you
Derek Kennard
19-Jul-15 16:11pm
View
Man, I have so much more to learn. Thank you for the information. I worked like a champ!
Derek Kennard
18-Jul-15 23:04pm
View
Deleted
I cleaned up the XAML a bit, if it helps.
<tabitem header="Vitals">
<groupbox header="Vital Signs" fontweight="Bold" borderbrush="Black" borderthickness="1"
="" margin="10">
<stackpanel businesslogic:marginsetter.margin="5">
<grid>
<grid.columndefinitions>
<columndefinition width="80">
<columndefinition width="100">
<columndefinition width="80">
<columndefinition width="100">
<grid.rowdefinitions>
<rowdefinition height="40">
<rowdefinition height="40">
<rowdefinition height="40">
<Label Content="HR:" FontWeight="Normal"
Height="27" Grid.Row="0" Grid.Column="0" />
<textbox x:name="TbHr" textwrapping="Wrap" text="" grid.row="0" grid.column="1"
="" width="85" height="27">
<Label Content="RR:" FontWeight="Normal" Grid.Row="1" Grid.Column="0"
Height="27" />
<textbox x:name="TbRr" textwrapping="Wrap" text="" grid.row="1" grid.column="1"
="" width="85" height="27">
<Label Content="BP:" FontWeight="Normal" Grid.Row="2" Grid.Column="0"
Height="27" />
<textbox x:name="TbBp" textwrapping="Wrap" text="" grid.row="2" grid.column="1"
="" width="85" height="27">
<Label Content="Weight:" FontWeight="Normal" Grid.Row="0" Grid.Column="2"
Height="27" />
<textbox x:name="TbWgt" textwrapping="Wrap" text="" grid.row="0" grid.column="3"
="" width="85" height="27">
<Label Content="Weight Type:" FontWeight="Normal" Grid.Row="1" Grid.Column="2"
Height="27" ToolTip="lb or kg" />
<textbox x:name="TbWgtType" textwrapping="Wrap" text="" grid.row="1" grid.column="3"
="" width="85" height="27">
<Label Content="Vital Date:" FontWeight="Normal" Grid.Row="2" Grid.Column="2"
Height="27" ToolTip="lb or kg" />
<textbox x:name="TbVitalDate" textwrapping="Wrap" text="" grid.row="2" grid.column="3"
="" width="85" height="27">
Derek Kennard
1-Jun-15 19:22pm
View
I would like to get them from Active Directory
Derek Kennard
1-Jun-15 19:12pm
View
That's what I'm looking for help on. I can't figure out how to set it.
Derek Kennard
25-May-15 1:45am
View
Sorry I can't get the concept to you in a manner you can understand. RossMW's post was what I needed to fix the problem, so this is closed. Thank you
Derek Kennard
25-May-15 0:54am
View
Sorry, let's try it this way...
1. Open program
2. Open new window from program (I have a list view, it has items, i double click an item, it opens a window. In this case, it opens NewWindow1.xaml)
Does that make it better?
I do all the SQL and form data in NewWindow1.xaml. I want to close NewWindow1.xaml and re-open NewWindow1.xaml and not have any record of previous work.
Derek Kennard
25-May-15 0:51am
View
That's a ton of code, so maybe a sampling will help. I use a DataLogic project for all contact to the database.
namespace DataLogic
{
public class RetrieveFormData
{
public string a ton of variables...
public static void ReturnFormData()
{
using (
var conn =
new SqlConnection(ConfigurationManager.ConnectionStrings["Dbconn"].ConnectionString))
{
try
{
var preSql = Settings.Default.SqlRetrieveData;
var sql = preSql + "@p1 = " + PatId;
conn.Open();
using (var cmd = new SqlCommand(sql, conn))
{
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
var1 = reader[0].ToString();
var2= reader[1].ToString();
etc...
}
}
}
}
catch (SqlException ex)
{
// Build custom message box for exception upload
var msg = "RetrieveFormData.ReturnFormData() Error: " + Environment.NewLine + ex;
var title = Resources.CustomMsgBxTitle;
MessageBoxManager.Ok = "Copy";
MessageBoxManager.Cancel = "Ignore";
MessageBoxManager.Register();
var result = MessageBox.Show(msg, title, MessageBoxButtons.OKCancel, MessageBoxIcon.Hand);
switch (result)
{
case DialogResult.OK:
Clipboard.SetText(msg);
break;
case DialogResult.Cancel:
break;
}
MessageBoxManager.Unregister();
Log.Error("Exception Thrown: " + msg + " - for Patient ID: " + PatId);
}
finally
{
conn.Close();
Log.Info("Closing SQL Connection for RetrieveFormData.ReturnFormData()");
}
}
}
}
}
Derek Kennard
25-May-15 0:21am
View
I am now... :)
I edited the XAML to use the steps in "Way 2" in this article. It helped me avoid the the user pressing the button when I dont want them too... (http://www.codeproject.com/Tips/215457/How-to-make-Button-Enable-Disable-depends-on-a-Tex)
I also implemented this articles concept as well:
https://msdn.microsoft.com/en-us/library/system.idisposable.dispose%28v=vs.110%29.aspx
If you any more information on the above IDisposable method or hints to apply to the examples, I would appreciate it. For the most part, implementing the Dispose() in this code seems to do it...
Derek Kennard
24-Feb-15 0:58am
View
I figured it out...
I used
using (
var conn =
new SqlConnection(ConfigurationManager.ConnectionStrings["Dbconn"].ConnectionString))
More importantly, App.config is not to be included in the installation, but the MyApp.exe.config...
Thank you jmcilhinney @ http://www.vbforums.com/showthread.php?551760-2005-app.config-included-in-setup
and
Thank you Abhinav
Derek Kennard
23-Feb-15 20:38pm
View
These dont seem to work. When I add the code in first article, it throws an "Object reference not set to an instance of an object"... (geeze, thanks for the helpful error message :))
If it matters or helps, I have the SQL connection and code in a DataLogic project and the form in a UserInterface project.
So, here's the code. Do you see anything wrong? - After the final {, the code is the same as above.
public static void GetPatient()
{
try
{
var dbcon = ConfigurationManager.ConnectionStrings["Dbconn"].ConnectionString;
var conn = new SqlConnection(dbcon);
{
I've also tried this and the same result.
public static void GetPatient()
{
try
{
string dbcon = ConfigurationManager.ConnectionStrings["Dbconn"].ConnectionString;
using (SqlConnection conn = new SqlConnection(dbcon))
{
Derek Kennard
11-Dec-14 9:11am
View
Thank you for the link. I can use this to make the request work. Thanks again!
Derek Kennard
13-Sep-14 20:04pm
View
Forgot something:
private bool _bln = true;
Derek Kennard
13-Sep-14 20:00pm
View
Deleted
Sorry,
This: I need some help. I have a button were the text is Update on form load. When I press the button, it changes to Update.
Actually means:
I need some help. I have a button were the text is Update on form load. When I press the button, it changes to SAVE.
Show More