16,013,592 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 mikeoabban (Top 61 by date)
mikeoabban
24-Jun-15 14:05pm
View
i have tried using PDO and MySQLi to connect but the data is not able to store into the database
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line
echo 'Connected to Database<br/>';
$value = $_POST['input1'];
$sql = "INSERT INTO demo (input1) VALUES ('$value')";
$dbh = null;
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>
and this
host_info . "\n";
$mysqli->close();
?>
please help me out
mikeoabban
24-Oct-14 13:06pm
View
the value of dtpDate1 and dtpDate2 are taking from 2 dateTimePicker
mikeoabban
17-May-14 0:54am
View
i am using a windows form in c# and ListItem is generating an error
mikeoabban
17-May-14 0:50am
View
no my form the system administrator enters data into the tblministries table (e.g. A B C D E F) using save button. when the form loads, A B C D E F loads into the checkedlistbox (cblMinistries). a user can check any of the data in the checkedlistbox (e.g. B C F) Which is saved into the tblMembershipministry table with the member ID. when a member enter his ID and click the search button, the form should load A B C D E F into the checkedlistbox and any data with the member ID from the tblMembershipministry table (B C F) should be checked.
please how do i resolve the problem. thank you
CREATE TABLE tblMinistries
(Homecellid int IDENTITY constraint pkMinid primary key clustered,
Homecellname varchar(300)not null)
CREATE TABLE tblMembershipministry
(FormattedMembershipid varchar(300),
Ministryname varchar(300)not null)
mikeoabban
16-May-14 15:29pm
View
this is the code i used to bind cblMinistries
public void PopuMinistry()
{
SqlConnection conn = new SqlConnection("Data Source=USER-PC;Initial Catalog=PIWCDB;User ID=sa;Password=mike");
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
string SqlDataPull = ("select Homecellname from tblministries order by Homecellname");
SqlCommand cmd = new SqlCommand(SqlDataPull);
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
SqlDataPull = dr[0].ToString();
cblMinistries.Items.Add(SqlDataPull);
}
dr.Close();
}
mikeoabban
16-May-14 12:46pm
View
i tried it but got the error "Unable to cast object to type 'System.String' to type 'System.Data.DataRowView'." what might be the problem
mikeoabban
16-May-14 12:26pm
View
can you help me out
mikeoabban
16-May-14 12:25pm
View
yes. that is where the error is coming from
mikeoabban
7-May-14 20:20pm
View
thanks for the help. am using this codes but not working. what might be problem
public void Newsearch()
{
SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
conn.ConnectionString = "Data Source=USER-PC;Initial Catalog=PIWCDB;User ID=sa;Password=mike";
conn.Open();
SqlCommand cmd = new SqlCommand();
string sqlQuery = "SELECT Ministryname FROM tblMembershipministry WHERE FormattedMembershipid = '" + this.txtMembershipid.Text + "'";
// System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
cmd.Connection = conn;
cmd.CommandText = sqlQuery;
cmd.CommandType = System.Data.CommandType.Text;
System.Data.SqlClient.SqlDataReader dr = null;
dr = cmd.ExecuteReader();
if (dr.Read())
{
foreach (int i in cblMinistries.CheckedIndices)
{
cblMinistries.SetItemCheckState(i, CheckState.Checked);
}
}
}
mikeoabban
7-May-14 19:13pm
View
my problem is how to loop through and check them in the checklistbox.
please have a look at the improved question
mikeoabban
7-May-14 6:49am
View
i get this errors- An expression of non-boolean type specified in a contex where a condition is expected near isnull
mikeoabban
7-May-14 4:31am
View
thank you very much for your help. i have modify the question a little bit . please help me out
mikeoabban
15-Apr-14 4:14am
View
this is a windows form application in c#
mikeoabban
13-Apr-14 8:14am
View
i get the message UI does not exsit in the name space 'system.web'
what should i do
mikeoabban
27-Mar-14 11:57am
View
thanks Richard it worked
mikeoabban
8-Aug-13 10:03am
View
i tried it but still does not display the answers in decimals but
display them to the nearest whole number
mikeoabban
3-Aug-13 15:47pm
View
i tried and only displayed the last row in the db
mikeoabban
3-Aug-13 15:35pm
View
please how do i read the dtatbase multiple times
mikeoabban
3-Aug-13 15:35pm
View
Deleted
please how do i read the dtatbase multiple times
mikeoabban
14-Jun-13 23:35pm
View
i added the code below and encountered two problems.
1, SetDBLogonForReport(crConnectionInfo, r); //error message does not exist in the current context
2, i already have his which loads the report using sql query
rptCollectorindividual objRpt = new rptCollectorindividual();
objRpt.Database.Tables[0].SetDataSource(tbl);
and i addeda new path which gives an error. that should i do
r.Load("D:\\my project\\Drms\\Ghpservice\\rptCollectorindividual.rpt");
\\ the codes
ReportDocument r = new ReportDocument();
r.Load("D:\\my project\\Drms\\Ghpservice\\rptCollectorindividual.rpt");
ConnectionInfo crConnectionInfo = new ConnectionInfo();
crConnectionInfo.DatabaseName = "MUCGPROJECT";
crConnectionInfo.UserID = "sa";
crConnectionInfo.Password = "mike";
SetDBLogonForReport(crConnectionInfo, r);//does not exist in the current context
crystalReportViewer1.ReportSource = r;
crystalReportViewer1.RefreshReport();
TableLogOnInfos crtablelognoinfos = new TableLogOnInfos();
TableLogOnInfo crtablelognoinfo = new TableLogOnInfo();
Tables CrTables;
CrTables = r.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtablelognoinfo = CrTable.LogOnInfo;
crtablelognoinfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtablelognoinfo);
}
mikeoabban
4-May-13 16:06pm
View
the problem is the code runs up to this point and jumps to the end of the code
k < dgvAddrecords.Rows.Count - 1;
what should i do
mikeoabban
24-Apr-13 11:22am
View
Deleted
the bindingSource works alright but am not able to update the data in the db using the result
from the bindingSource. i tried this which does not update anything. please help me out
private void btnUpdate_Click(object sender, EventArgs e)
{
string StrQuery;
try
{
using (SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]))
{
conn.ConnectionString = "Data Source=MICKY-PC;Initial Catalog=MUCGPROJECT;User ID=sa;Password=mike";
using (SqlCommand comm = new SqlCommand())
{
comm.Connection = conn;
//conn.Open();
for (int i = 0; i < dgvDistrict.Rows.Count; i++)
{
StrQuery = @"UPDATE DistrictnT SET District = '" + this.txtDistrict.Text + "', Town = '" + dgvDistrict.Rows[i].Cells["Town"].Value + "' WHERE District = '" + txtDistrict.Text + "'";
comm.CommandText = StrQuery;
conn.Open();
comm.ExecuteNonQuery();
conn.Close();
}
//cleardgv();
MessageBox.Show("Record is successfully Added");
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
mikeoabban
10-Apr-13 7:54am
View
i just got the answer. only code the codes from Keypress event to TextChanged event
thanks
mikeoabban
10-Apr-13 7:20am
View
Great it worked. thanks alot for the help.
when the form loads, the dgvContactpersonsearch gridview is hiden. i want it to be displayed on the form only when the first letter entered in the textbox muches the collectorid in the datatable. i tried removing dgvContactpersonsearch.Visible = true; from line 1 placed it here
if (filteredRows.Any()) //If any rows are matching
{
table = filteredRows.CopyToDataTable();
dgvContactpersonsearch.visible = true ;
}
but it still get displayed on the form when any key is pressed. what should i do thanks
mikeoabban
8-Apr-13 12:51pm
View
i get error mesage "The name dtfilter does not exist in the current context" here
dtfilter = filteredRows.CopyToDataTable();
dgvContactpersonsearch.DataSource = dtfilter ;
mikeoabban
5-Apr-13 14:37pm
View
thanks alot for the help, but am a learner in c#. i have tried using the codes but it keeps
given errors. can you please help me out with the full code
mikeoabban
4-Apr-13 15:16pm
View
data load into the grid only when you type something in the text box
mikeoabban
29-Dec-12 5:54am
View
thanks alot put am having problems passing the DataGridViewCellEventArgs to the method
can you help me with some piece of code
mikeoabban
25-Oct-12 9:57am
View
how do i format it to appaer like that on the form
mikeoabban
14-Oct-12 12:16pm
View
yes, but how do i get it from the griddview. thats the problem
mikeoabban
20-Jul-12 18:52pm
View
thanks you all for your support it is working and this is it
sqlQuery = "backup database SMS to disk = '" + backuppath + "\\SMS" + DateTime.Now.ToString("yyyy-MM-dd") + ".bak" + "'";
am now working on the restore form
mikeoabban
20-Jul-12 16:00pm
View
thanks for your. but it still give the error message Incorrect syntax near 'emp'.
for sqlQuery = "backup database SMS to disk = ''D:\temp\' + 'SMS' + DateTime.Now.ToShortDateString()'";
and error Cannot open backup device 'C:\Users\MICKY\Desktop\sms\SMS7/20/2012'. Operating system error 3(The system cannot find the path specified.).
BACKUP DATABASE is terminating abnormally.
for sqlQuery = "backup database SMS to disk = '" + backuppath + "\\SMS" + DateTime.Now.ToShortDateString()+ "'";
please am confused wat can i do
mikeoabban
13-Jul-12 17:38pm
View
thanks i never noticed it
mikeoabban
10-Jul-12 13:46pm
View
thanks alot it was perfect
mikeoabban
27-Jun-12 11:33am
View
thanks is it that simple. it worked
mikeoabban
26-Jun-12 16:34pm
View
thanks alot it worked. but the problem is it takes it value from a textbox into
the db. when the textbox is empty it inserts an empty space inot the db. what can
i do to prevent this
mikeoabban
14-Jun-12 19:33pm
View
i just found out that it is from my clearscreen method. and this is the problem this.txtFcs_exams.Text = "";
when i comment it out, there is no error message displayed. i tried this
if (string.IsNullOrEmpty(this.txtFcs_classwork.Text) && string.IsNullOrEmpty(this.txtFcs_ia.Text))
{
txtFcs_exams.Text = "";
}
but did not work. please how do i clear the text in txtFcs_exams
mikeoabban
14-Jun-12 16:23pm
View
the error comes when you click the save button.
in the sql2008 db i have this
fcs_classwork float,
fcs_ia float,
fcs_exams float,
fcs_totals float,
fcs_grading varchar (10),
could it be from here
mikeoabban
13-Jun-12 3:47am
View
thanks alot it worked
mikeoabban
5-Jun-12 10:34am
View
when i run this in sql environment it worked perfect but does not work from my c# form even if all condition are true delete from tblstaffsalarypaymentdetails where staffid ='001' and purpose = 'Allowance' and dateofpayment ='2012-06-04'
mikeoabban
5-Jun-12 9:48am
View
when i run this in sql environment it worked perfect but does not work from my
c# form even if all condition are true
delete from tblstaffsalarypaymentdetails where staffid ='001' and purpose = 'Allowance' and dateofpayment ='2012-06-04'
mikeoabban
30-May-12 4:12am
View
how do i load only staff id into a combo box cbostaffid5 after i have created
the loadID method
mikeoabban
30-May-12 4:11am
View
sorry am only selecting staffid from the table
mikeoabban
30-May-12 4:10am
View
how do i load only staff id into a combo box cbostaffid5 after i have created
the loadID method
mikeoabban
29-May-12 2:53am
View
it worked but after run the program and click on the search button i get this
message object reference not set to an instance of an object
pls what should ido
mikeoabban
25-May-12 14:46pm
View
it worked but the error message is still displaying first before the search result is displayed. how do i get raid of this error message?
mikeoabban
3-Mar-12 10:36am
View
thanks a lot
i'll try it now
mikeoabban
25-Feb-12 13:02pm
View
i added using System.IO; and the error was gone
thankx
mikeoabban
25-Feb-12 12:16pm
View
i try using MemoryStream but had an error message
The type or namespace name 'MemoryStream' could not be found (are you missing a using directive or an assembly reference?)
pls what should i do
mikeoabban
24-Feb-12 6:35am
View
i noticed in the class i used picture = dr["picture"].ToString();
i removed the ToString and got an error msg
Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)
what should i do pls
mikeoabban
24-Feb-12 5:38am
View
i removed the ToString and got this error message
Cannot implicitly convert type 'object' to 'System.Drawing.Image'. An explicit conversion exists (are you missing a cast?)
mikeoabban
16-Jan-12 2:26am
View
Hi, am using SQL 2000 does not support emun. so am using char data type.
in my class i have
public object sex
{
get { return gender; }
set { gender = value.ToString(); }
}
and also
gender = dr["gender"].ToString();
mikeoabban
11-Jan-12 17:41pm
View
thanks Mika, i now display the list view with the needed data.
if i want the data in the list view to respond to a 'double click'
how do i go about it
mikeoabban
8-Jan-12 12:49pm
View
i can't believe it, i just displayed the data in a list view.
but after displaying a message pop-up "object reference not set to an
instance of an object" what should i do
mikeoabban
8-Jan-12 11:18am
View
hi, was able to display the data in a data grid view (thnaks to your help)
am trying to display it in a LIST VIEW. can you please help me out
mikeoabban
4-Jan-12 14:16pm
View
ok i will go give it a try.
i will update you n the outcome
thanks alot
mikeoabban
4-Jan-12 14:10pm
View
Ok that is i have write a code to put the content of dr["surname"] to the new form (which is Fom1 )
if so then i will do my best to write the codes though this is my first c#
program
mikeoabban
4-Jan-12 13:41pm
View
i sometimes get this error message
ExecuteReader requires an open and available Connection. The connection's current state is closed
mikeoabban
4-Jan-12 13:07pm
View
am having this in the class surname = dr["surname"].ToString();
this behind the button _with9.txtSurname.Text = getidentity.Sname.ToString();
Pls where should i put this TextBoxSurName.Text = dr["surname"].ToString();
and how. am confused
mikeoabban
30-Dec-11 14:33pm
View
the result isnot displaying clientid, surname, othername on the form
mikeoabban
30-Dec-11 14:31pm
View
i just dont understand why the result is not displaying at all on the form
Show More