16,018,529 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 DevParashar (Top 14 by date)
DevParashar
15-May-14 2:40am
View
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace CMb
{
public partial class Form1 : Form
{
SqlConnection connect = new SqlConnection("Data Source=Admin;Initial Catalog=Practice_DatabaseSQL;User Id=sa;password=p@ssw0rd");
public Form1()
{
InitializeComponent();
bmbBind();
}
void bmbBind()
{
connect.Open();
SqlCommand cmd = new SqlCommand("SELECT Distinct SoftwareName from dbo.Keys", connect);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
cmbNameS.DataSource = dt;
cmbNameS.DisplayMember = "SoftwareName";
cmbNameS.ValueMember = "SoftwareName";
}
}
private void cmbVersion_SelectedIndexChanged(object sender, EventArgs e)
{
string query = "Select SKeys from dbo.Keys where SoftwareName='" + cmbVersion.SelectedValue + "'";
SqlCommand cmd = new SqlCommand(query, connect);
SqlDataReader data =cmd.ExecuteReader();
if ( data.Read())
{
txtKeys.Text = data.GetSqlValue(0).ToString();
}
}
private void cmbNameS_SelectedIndexChanged(object sender, EventArgs e)
{
string query = "Select VersionNo from dbo.Keys where SoftwareName='" + cmbNameS.SelectedValue + "'";
SqlCommand cmd = new SqlCommand(query, connect);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
cmbVersion.DataSource = dt;
cmbVersion.DisplayMember = "VersionNo";
cmbVersion.ValueMember = "VersionNo";
}
}
}
}
I have the following code changes but not able to get the desired output in the textbox
DevParashar
14-May-14 14:55pm
View
OK this is the code that i added but is not working..
private void cmbNameS_SelectedIndexChanged(object sender, EventArgs e)
{
string query = "Select VersionNo from dbo.Keys where SoftwareName='" + cmbNameS.SelectedValue + "'";
SqlCommand com = new SqlCommand(query, connect);
SqlDataReader dr = com.ExecuteReader();
if (dr.Read())
{
txtKeys.Text = dr["Key"].ToString();
}
}
DevParashar
14-May-14 14:42pm
View
Deleted
Could you please suggest this part of the code as I am not much familiar to C# coding..
Will be very helpful..
DevParashar
13-May-14 2:09am
View
The error is as follows:
(
System.Data.OleDb.OleDbException: Could not finf installable ISAM. at System.Data.OleDb.OleDbConnectionInternal..ctor(OnleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb
DevParashar
10-May-14 23:55pm
View
Deleted
I am making a simple application using ms access as my database. The application has two types of users ADMIN and employees. Based on my Login there are certain feature that need to be allowed/restricted - such as if i login as employee I will get only to add data to my work and view my results and search for my work related results. But as an admin i should have full access to my application and database. I have to create this using C# and Windows Forms Application..
Thanks and regards
DevParashar
10-May-14 12:53pm
View
Deleted
Thanks.. the link is quite useful.. But I would like to use my login screen to have the control to show or hide/disable certain controls of the form as well as the actions the user can perform...
DevParashar
6-Mar-14 8:47am
View
no i did not
DevParashar
6-Mar-14 5:39am
View
No use.... Still getting the same problem...
m sending my revised codes::
<!DOCTYPE HTML>
<html>
<head>
<title>Fetching saved records</title>
</head>
<body>
<div class="container">
<div class="displaydetails">
<form method="POST" action="RetrieveandDisplay.php">
Enter the name to search data:<br/>
<input type="text" name="FetchDetails">
<input type="submit" name="Find" value="Find Data"/>
</form>
</div>
</div>
</body>
</html>
---------------------------------------------------------------------------------
<!--?php include('connectionstring.php');
if(!$connection)
{
die('Could not connect to database : '.mysql_error());
}
$inputname=$_POST['FetchDetails'];
$myquery="SELECT * FROM addentry WHERE FirstName='%s'";
$fetched=mysql_query($myquery);
if(!$fetched)
{
$message='Invalid Entry:'.mysql_error();
die($message);
}
while($rowvalue=mysql_fetch_assoc($fetched))
{
$firstname=$rowvalue['FirstName'];
$middlename=$rowvalue['MiddleName'];
$lastname=$rowvalue['LastName'];
$phone1=$rowvalue['Phone1'];
$phone2=$rowvalue['Phone2'];
$email=$rowvalue['Email'];
$address=$rowvalue['Address'];
}
??-->
<html>
<body>
<div class="container">
<div class="fetched">
<form>
<label>First Name</label>
<input name="FirstName" type="text" value='<!--?php echo $firstname; ??-->'/>
<label>Middle Name</label>
<input name="MiddleName" type="text" value='<!--?php echo $middlename; ??-->'/>
<label>Last Name</label>
<input name="LastName" type="text" value='<!--?php echo $lastname; ??-->'/>
<label>Phone1</label>
<input name="Phone1" type="text" value='<!--?php echo $phone1; ??-->'/>
<label>Phone2</label>
<input name="Phone2" type="text" value='<!--?php echo $phone2; ??-->'/>
<label>Email</label>
<input name="email" type="text" value='<!--?php echo $email; ??-->'/>
<label>Address</label>
<textarea id="Address" name="address1" value='<!--?php echo $address; ??-->'></textarea>
</form>
</div>
</div>
</body>
</html>
DevParashar
6-Mar-14 2:55am
View
Thanks... but now a new problem is showing .... The code works fine taking the input and all but in the output window it shows error messages inside the textboxes that i created...
Something like this
<br />
Notice
: Undefined variable: firstname in
C:\EasyPHP-DevServer-14.1VC9\data\localweb\Final_Project\RetrieveandDisplay.php
on line
39
<br />
This message is showing for all text boxes
DevParashar
6-Mar-14 1:36am
View
The following error was thrown:
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in C:\EasyPHP-DevServer-14.1VC9\data\localweb\Final_Project\RetrieveandDisplay.php on line 13
DevParashar
5-Mar-14 10:01am
View
Hi, I have this php code
<html>
<body>
<div class="container">
<div class="fetched">
<form>
<label>First Name</label>
<input name="firstname" type="text" value=''/>
<label>Middle Name</label>
<input name="middlename" type="text" value=''/>
<label>Last Name</label>
<input name="lastname" type="text" value=''/>
<label>Phone1</label>
<input name="phone1" type="text" value=''/>
<label>Phone2</label>
<input name="phone2" type="text" value=''/>
<label>Email</label>
<input name="email" type="text" value=''/>
<label>Address</label>
<textarea id="address" name="address1" value=''/>
</form>
</div>
</div>
</body>
</html>
DevParashar
4-Mar-14 13:18pm
View
DevParashar
4-Mar-14 12:00pm
View
<!DOCTYPE HTML>
<html>
<head>
<title>Retrieve Contact</title>
</head>
<body>
<div class="container">
<div class="dsp">
<form method="POST" action="retrievedetails.php">
Enter the first name of any contact to fetch: <br/>
<input type="text" name="FetchName"/>
<input type="submit" name="submit" value="Fetch Details"/>
</form>
</div>
</div>
</body>
</html>
PHP code
DevParashar
4-Mar-14 11:59am
View
I have created a page in html where i have placed a textbox and the user will supply the value in it which will then retrieve the data corresponding to the value from my mysql database. I am unable to retrieve the data.
<!DOCTYPE HTML>
<html>
<head>
<title>Retrieve Contact</title>
</head>
<body>
<div class="container">
<div class="dsp">
<form method="POST" action="retrievedetails.php">
Enter the first name of any contact to fetch: <br/>
<input type="text" name="FetchName"/>
<input type="submit" name="submit" value="Fetch Details"/>
</form>
</div>
</div>
</body>
</html>
Here is my PHP code.
Show More