16,012,508 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 khalid4775 (Top 29 by date)
khalid4775
24-Aug-22 11:50am
View
the IDs is ok
i have inspect the element data-bs-target="#default1"
the id is 1
khalid4775
21-Aug-22 10:42am
View
now iam getting this error in console
vendors.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'classList')
at Nt._isAnimated (vendors.min.js:2:161622)
at Nt._initializeBackDrop (vendors.min.js:2:159691)
at new Nt (vendors.min.js:2:158142)
at Nt.getOrCreateInstance (vendors.min.js:2:114697)
at HTMLButtonElement.<anonymous> (vendors.min.js:2:162919)
at HTMLDocument.i (vendors.min.js:2:112370)
_isAnimated @ vendors.min.js:2
_initializeBackDrop @ vendors.min.js:2
Nt @ vendors.min.js:2
getOrCreateInstance @ vendors.min.js:2
(anonymous) @ vendors.min.js:2
i @ vendors.min.js:2
khalid4775
21-Aug-22 4:10am
View
Thanks :)
khalid4775
20-Dec-20 8:31am
View
Any Others would like to help ??
khalid4775
19-Dec-20 12:44pm
View
No problems at all thanks for trying to help me :)
Hope to find some one to help
khalid4775
19-Dec-20 12:18pm
View
i have been created the object but iam getting the error below
CS0161 'ManageVisitsTypesService.InsertVisitsTypes(int, string, bool, string, int)': not all code paths return a value
khalid4775
19-Dec-20 11:08am
View
Yes that what i did but its not inserting the data to database
Cannot implicitly convert type 'bool' to 'DBHelper.SaveResult'
In DBHelper.SaveResult contain this
public enum SaveResult
{
Ok,
DuplicateId,
DuplicateName,
UnknownError,
}
khalid4775
19-Dec-20 10:23am
View
yes i have tried that like so :
ManageVisitsTypesService.InsertVisitsTypes(ManageVisitsTypesModel.VisitTypeID, ManageVisitsTypesModel.VisitTypeName, ManageVisitsTypesModel.VisitTypeStatus, ManageVisitsTypesModel.VisitTypeNotes, ManageVisitsTypesModel.CreatedBy);
but its getting the same error
khalid4775
15-Dec-20 10:40am
View
this works correct :)
MemoryStream ms = new MemoryStream((byte[])selectedRow.Cells[5].Value);
iops.CustomerPhoto = Image.FromStream(ms);
khalid4775
15-Dec-20 10:35am
View
i tried but not working i got this error :
'Unable to cast object of type 'System.Byte[]' to type 'System.Drawing.Image
khalid4775
15-Dec-20 10:26am
View
Thanks alot for help yes working fine now
but if i want get the photo from datagridview to picturebox on click event i use this method :
public void GetDataToTextBox(DataGridViewCellEventArgs e)
{
int index = e.RowIndex;// get the Row Index
DataGridViewRow selectedRow = iops.DataGridViewRows.Rows[index];
iops.CustomerID = Convert.ToInt32(selectedRow.Cells[0].Value);
iops.CustomerName = selectedRow.Cells[1].Value.ToString();
iops.CustomerEmail = selectedRow.Cells[2].Value.ToString();
iops.CustomerPhone = selectedRow.Cells[3].Value.ToString();
iops.CustomerStatus = Convert.ToBoolean(selectedRow.Cells[4].Value);
iops.CustomerPhoto = selectedRow.Cells[5].Value;
}
but there error Cannot implicitly convert type 'object' to 'System.Drawing.Image'. An explicit conversion exists (are you missing a cast?)
khalid4775
15-Dec-20 8:52am
View
Thanks but it dosent work i change the property to Image on all classes
Interface :
Image CustomerPhoto { get; set; }
Model:
public Image CustomerPhoto { get; set; }
And Finally Impemented in the form as
public Image CustomerPhoto
{
get => pictureBox1.Image;
set => pictureBox1.Image = value;
}
not able to insert or update image
Kind Regards :)
khalid4775
12-Dec-20 6:09am
View
How can i insert image database
khalid4775
11-Dec-20 8:50am
View
Updated ...
khalid4775
10-Dec-20 12:06pm
View
Iam New in MVP can you modify it for me ?
Thanks
khalid4775
10-Dec-20 11:35am
View
Updated The Question :)
khalid4775
3-Dec-20 12:20pm
View
Solved Thanks :)
just added
using static Test.Data_Layer.DataAccessLayer;
khalid4775
3-Dec-20 11:41am
View
ok sir i have added CustomerSaveResult enum to DAL class but iam unable call it to other class or form : i added this to DAL class :
public enum CustomerSaveResult
{
Ok,
DuplicateId,
DuplicateName,
UnknownError,
}
khalid4775
3-Dec-20 11:29am
View
private void button3_Click(object sender, EventArgs e)
{
if (textBox3.Text.Trim() == "")
{
MessageBox.Show("Enter Customer Name");
return;
}
CustomerSaveResult saveResult = Saving.Save_Customers(Convert.ToInt32(textBox4.Text.Trim()), textBox3.Text.Trim());
if (saveResult == CustomerSaveResult.DuplicateId)
{
MessageBox.Show("Custumer Id Exites");
}
else if (saveResult == CustomerSaveResult.DuplicateName)
{
MessageBox.Show("Custumer Name Exites");
}
{
khalid4775
3-Dec-20 11:28am
View
https://ibb.co/2ZPzc0t
Error CS0266 Cannot implicitly convert type 'Test.Business_Layer.CLS_AddUpdateDelete.CustomerSaveResult' to 'Test.PL.FrmAddUpdateDelete.CustomerSaveResult'. An explicit conversion exists (are you missing a cast?)
khalid4775
3-Dec-20 11:24am
View
https://ibb.co/TH4r0Vj
khalid4775
3-Dec-20 11:20am
View
Yes serious iam new in C# so i try to read and search for solution for my errors before i send question
now i got error
Cannot implicitly convert type to. An explicit conversion exists (are you missing a cast?)
can you help me with this :)
https://ibb.co/TH4r0Vj
khalid4775
3-Dec-20 9:45am
View
Thank you Thank you Thank you
i have add this code to button save
Saving.Save_Customers(Convert.ToInt32(textBox4.Text.Trim()), textBox3.Text.Trim());
How to inspect the returned CustomerSaveResult value and display it in message
Than you very much
khalid4775
3-Dec-20 8:57am
View
Thanks For help but iam getting errors :
1.CS0246 C# The type or namespace name could not be found (are you missing a using directive or an assembly reference?)
2.CS0103 C# The name does not exist in the current context
https://ibb.co/t20h3N3][img]https://i.ibb.co/090XQWQ/d.jpg[^][^]
khalid4775
10-Apr-17 11:44am
View
http://store6.up-00.com/2017-04/149183753091961.jpg
But image is there
http://store6.up-00.com/2017-04/149183753103342.jpg
khalid4775
10-Apr-17 11:34am
View
in Module
khalid4775
10-Apr-17 11:32am
View
i have tried this
@CustomerID int output,
@CustomerName nvarchar (50),
@CustomerPhoto image = null,
@CustomerEmail nvarchar(Max),
@CustomerPhone1 nvarchar(12),
@CustomerPhone2 nvarchar(12),
@CustomerAddress nvarchar(Max),
@CustomerFax nvarchar(12),
@CustomerStatus bit,
@CountryID int,
@CityID int,
@Notes nvarchar (Max),
@ModifiedBy nvarchar (30)
as
BEGIN
update CustomersTbl set
CustomerID=@CustomerID,
CustomerName=@CustomerName,
CustomerPhoto=@CustomerPhoto,
CustomerEmail=@CustomerEmail,
CustomerPhone1=@CustomerPhone1,
CustomerPhone2=@CustomerPhone2,
CustomerAddress=@CustomerAddress,
CustomerFax=@CustomerFax,
CustomerStatus=@CustomerStatus,
CountryID=@CountryID,
CityID=@CityID,
Notes=@Notes,
ModifiedDate=getdate(),
ModifiedBy=@ModifiedBy
where CustomerID=@CustomerID
END
But the image has been set to Null
khalid4775
10-Apr-17 11:26am
View
http://store6.up-00.com/2017-04/149183753091961.jpg
But image is there
http://store6.up-00.com/2017-04/149183753103342.jpg
khalid4775
10-Apr-17 11:25am
View
Public Function GetPhoto(ByVal filePath As String) As Byte()
Dim stream As FileStream = New FileStream(filePath, FileMode.Open, FileAccess.Read)
Dim reader As BinaryReader = New BinaryReader(stream)
Dim photo() As Byte = reader.ReadBytes(stream.Length)
reader.Close()
stream.Close()
Return photo
End Function
Public Function byteArrayToImage(ByVal byt As Byte()) As Image
Dim ms As New System.IO.MemoryStream()
Dim drwimg As Image = Nothing
Try
ms.Write(byt, 0, byt.Length)
drwimg = New Bitmap(ms)
Finally
ms.Close()
End Try
Return drwimg
End Function
Show More