15,893,668 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 Goran Bibic (Top 200 by date)
Goran Bibic
19-Jul-22 5:13am
View
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'A' to data type int.
Ok, i find another way
Goran Bibic
17-Jul-22 11:18am
View
Complete code dont work with error
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'A' to data type int.
In this line
(CASE WHEN prazno2 IS NULL THEN CONVERT(INT, CONVERT(VARCHAR(12), 'A')) ELSE prazno2 END) as Rb
;With cte1 as
(
SELECT p.redni_broj, p.sifra_crteza,(n.redni_broj) as id, n.sifra, p.opis_sifre, n.naziv, null as prazno,null as prazno2
from registracija_narudzbe_stavke p
inner join registracija_narudzbe_materijal n on p.sifra_crteza = n.crtez
), cte2 as
(
select redni_broj, id, sifra, sifra_crteza, opis_sifre, naziv, prazno, prazno2
from cte1
union
select p.redni_broj, null as nr, null as Material, p.sifra_crteza, opis_sifre, null as naziv, null as prazno,
NULLIF(p.redni_broj,0) as prazno2
from registracija_narudzbe_stavke p
)
select
(CASE WHEN prazno2 IS NULL THEN CONVERT(INT, CONVERT(VARCHAR(12), 'A')) ELSE prazno2 END) as Rb
,(CASE WHEN CAST(id AS varchar(255)) IS NULL THEN '99' ELSE id END) as RB2
,isnull(sifra, sifra_crteza) Sifra
, isnull(naziv,opis_sifre) Opis
from cte2
order by redni_broj
,case when prazno2=0 then 4 else 6 end
Goran Bibic
17-Jul-22 4:58am
View
Where is LETTER A on your result?
Goran Bibic
17-Jul-22 4:10am
View
SELECT COALESCE(CAST([prazno2] AS VARCHAR(30)), 'A') AS Rb FROM DBO.cte
I try this, you write, I just copy and have same error
Conversion failed when converting the varchar value 'A' to data type int.
Goran Bibic
17-Jul-22 3:52am
View
prazno2 is data type int and don't work...same error
Conversion failed when converting the varchar value 'A' to data type int.
Goran Bibic
15-Jul-22 5:56am
View
Solution is close of result:
Result need to be
(No column name) (No column name)
1 D1234
1 TUBE
2 SHEET METAL
2 C1234
1 BAR
Goran Bibic
11-Jul-22 3:26am
View
I add new form and visual studio is change all extension, back from class to from cs. Thank you
Goran Bibic
11-Jul-22 3:25am
View
I add new form and visual studio is change all extension, back from class to from cs. Thank you
Goran Bibic
11-Jul-22 3:08am
View
Right picture is ok, left is wrong. I cant open form on left picture project. How is possible instead form to be class? How to open form? On double click before open form, now open class
Goran Bibic
8-Jul-22 10:56am
View
Please just watch picture
Left pic is wrong, right is ok
https://www.c-sharpcorner.com/forums/i-press-something-and-change-formcs-to-classcs
Please
Goran Bibic
8-Jul-22 10:56am
View
Please just watch picture
Left pic is wrong, right is ok
https://www.c-sharpcorner.com/forums/i-press-something-and-change-formcs-to-classcs
Please
Goran Bibic
8-Jul-22 9:34am
View
Can I here post picture?
Goran Bibic
8-Jul-22 9:34am
View
Can I here post picture?
Goran Bibic
8-Jul-22 9:33am
View
In visual studio, add form. All ok. When doblue click on SOlution expoler opne Form1 and I add controls to form. Something changes now, when double click on Form1 open code. I can't open Form design. What I do?
Goran Bibic
8-Jul-22 9:33am
View
In visual studio, add form. All ok. When doblue click on SOlution expoler opne Form1 and I add controls to form. Something changes now, when double click on Form1 open code. I can't open Form design. What I do?
Goran Bibic
21-Jun-22 1:28am
View
THIS WORK. THANK YOU
Goran Bibic
20-Jun-22 7:30am
View
I try this
delete from dbo.trebovnica_roba_roba
where NOT EXISTS (
select MIN(id), sifra
from dbo.trebovnica_roba_roba
where id_fakture=12 and rn='RN 002 2022'
group by sifra
)
O rws affected, nothing happend
Goran Bibic
20-Jun-22 7:28am
View
This is ok condition
Goran Bibic
20-Jun-22 7:27am
View
Need to delete all exception this condition
select MIN(id) as id, sifra from dbo.trebovnica_roba_roba where id_fakture=7 and rn='RN 002 2022' group by sifra
Goran Bibic
20-Jun-22 7:24am
View
I try to explane
id_fakure column ('RN 002 2022') and rn('7') are same for all items
Query need to delete all rows with same SIFRA and diferent ID exept firsT min(id)-NAME ROW
In this case minimal id for sifra DWL00446 is 13, for next sifra 0.0455655.C minimal id is 14
Other rows (becose have just 2 different sifra names in table) need to be deleted
Goran Bibic
20-Jun-22 7:10am
View
How to remove all rows except first minimal id and sifra
This need to stay
13 DWL00446 RN 002 2022 7
14 0.0455655.C RN 002 2022 7
other rows to delete
id sifra id_fakture rn
13 DWL00446 RN 002 2022 7
14 0.0455655.C RN 002 2022 7
15 0.0455655.C RN 002 2022 7
16 DWL00446 RN 002 2022 7
17 DWL00446 RN 002 2022 7
18 0.0455655.C RN 002 2022 7
19 0.0455655.C RN 002 2022 7
Goran Bibic
20-Jun-22 6:58am
View
YES and result need to be
13 DWL00446 RN 002 2022 7
14 0.0455655.C RN 002 2022 7
Other deleted, but result is 0 rows affected? Mising some detail
Why SELECT 1?
Goran Bibic
20-Jun-22 6:35am
View
Simple question
Condition
How to remove all rows exept first minimal id and sifra
Table
id sifra id_fakture rn
13 DWL00446 RN 002 2022 7
14 0.0455655.C RN 002 2022 7
15 0.0455655.C RN 002 2022 7
16 DWL00446 RN 002 2022 7
17 DWL00446 RN 002 2022 7
18 0.0455655.C RN 002 2022 7
19 0.0455655.C RN 002 2022 7
Goran Bibic
20-Jun-22 6:35am
View
Simple question
Condition
How to remove all rows exept first minimal id and sifra
Table
id sifra id_fakture rn
13 DWL00446 RN 002 2022 7
14 0.0455655.C RN 002 2022 7
15 0.0455655.C RN 002 2022 7
16 DWL00446 RN 002 2022 7
17 DWL00446 RN 002 2022 7
18 0.0455655.C RN 002 2022 7
19 0.0455655.C RN 002 2022 7
Goran Bibic
20-Jun-22 5:51am
View
This are condition
id_fakture=7 and NOT EXISTS (select MIN(id), sifra from dbo.trebovnica_roba_roba where id_fakture=7 and rn='RN 002 2022' group by sifra)
if remove id_fakture=7 then delete all values in table
id_fakture is not id, id_fakture is control field for condition.
id is id in table
Goran Bibic
21-Sep-21 3:23am
View
Ok. Question. How you search datagrid from textbox?
Goran Bibic
21-Sep-21 2:16am
View
Search datagrid from textbox
Goran Bibic
21-Sep-21 2:04am
View
Ok. How to repair code? I try this but dont work, search just datagrid from 1 textbox
(EmailDataGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("[Ime i prezime] LIKE '%{0}%' OR [Preduzece] LIKE '%{0}%' OR [E-mail] LIKE '%{0}%' ", SearchTextBox.Text + SearchTextBox2.Text);
Goran Bibic
21-Sep-21 2:03am
View
Ok. How to repair code? I try this but dont work, search just datagrid from 1 textbox
(EmailDataGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("[Ime i prezime] LIKE '%{0}%' OR [Preduzece] LIKE '%{0}%' OR [E-mail] LIKE '%{0}%' ", SearchTextBox.Text + SearchTextBox2.Text);
Goran Bibic
20-May-21 7:02am
View
not seeing the count in the textbox...code no errors
Goran Bibic
20-May-21 5:19am
View
I try, but no error, dont work
Goran Bibic
20-May-21 5:19am
View
I try, but no error, dont work
Goran Bibic
5-Nov-20 8:41am
View
I try this
BarcodeEAN ean13 = new BarcodeEAN();
ean13.CodeType = Barcode.EAN13;
ean13.ChecksumText = true;
ean13.GenerateChecksum = true;
ean13.Code = Convert.ToString(BarcodeEAN.GetBarsEAN13(row.Cells[12].Value.ToString()));
System.Drawing.Bitmap bm = new System.Drawing.Bitmap(ean13.CreateDrawingImage(System.Drawing.Color.Black, System.Drawing.Color.White));
Error: Index was outside the bounds of the array
Goran Bibic
5-Nov-20 8:41am
View
I try this
BarcodeEAN ean13 = new BarcodeEAN();
ean13.CodeType = Barcode.EAN13;
ean13.ChecksumText = true;
ean13.GenerateChecksum = true;
ean13.Code = Convert.ToString(BarcodeEAN.GetBarsEAN13(row.Cells[12].Value.ToString()));
System.Drawing.Bitmap bm = new System.Drawing.Bitmap(ean13.CreateDrawingImage(System.Drawing.Color.Black, System.Drawing.Color.White));
Error: Index was outside the bounds of the array
Goran Bibic
28-Oct-20 16:59pm
View
pdfDoc.Add(new ListItem(" Quantity: " + ArtikliKolicinaTextBox.Text), calibri10bold));
Result is 1.0000
Need to be result 1
Goran Bibic
28-Oct-20 16:58pm
View
Deleted
Nothigh. Thank you
Goran Bibic
28-Oct-20 16:48pm
View
I have value in textbox 1.000 need to have on print value 1
Goran Bibic
11-Sep-20 5:19am
View
I not need step by step. Need answer is that posible or some link.
Thank you
Goran Bibic
30-Jul-20 1:39am
View
Ok. How to do that?
Goran Bibic
15-Jun-20 12:28pm
View
Thank you. Not need help from you. By
Goran Bibic
15-Jun-20 12:18pm
View
I have way with axAcroPDF1
I need most simple way
Goran Bibic
15-Jun-20 12:14pm
View
1) Need to save pdf file to database, ms sql, data type varbinary (MAX)
2) Need to open that file from db with default pdf app
Goran Bibic
31-May-20 14:54pm
View
(TeamsDataGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("[Name] LIKE '%{0}%' OR [SubName] LIKE '%{1}%' OR [Sport] LIKE '%{2}%'", SearchListTextBox.Text);
Where to put .Split() ?
Goran Bibic
31-May-20 14:46pm
View
Where to put .Split() ?
Goran Bibic
16-Apr-20 12:57pm
View
I need that fo itext sharp
Goran Bibic
16-Apr-20 10:41am
View
Thank you
Goran Bibic
26-Mar-20 2:12am
View
Not for you...this is for Maciej Los ...thank you for solution
Goran Bibic
25-Mar-20 2:27am
View
If don't help do not comment. Thank you
Goran Bibic
21-Jan-20 1:55am
View
I post Result
Radnik Prijava Odjava Radni sati(Work) Nocni(Night)
Bibic Goran 22 6 8 8
Goran Bibic
12-Dec-19 7:37am
View
cmd.Parameters.AddWithValue("@pdv", iznosSaPdvom - (novaCijenaBezPdva * double.Parse(row.Cells["kolicina"].Value.ToString())));
How to put here - ?
Goran Bibic
12-Dec-19 7:16am
View
This is part of code, in database is value 1.00
I need to save in database value -1.00
Need Help like this or...
cmd.Parameters.Add("@iznos_sa_pdv", SqlDbType.VarChar, 255).Value = '-'ukupnolabel.Text;
Goran Bibic
7-Dec-19 5:31am
View
Deleted
https://www.c-sharpcorner.com/forums/export-to-excel-c-sharp
Error is here
excel.Visible = true;
Goran Bibic
22-Nov-19 5:25am
View
Like this
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BSS
{
class Podaci_o_korisniku
{
private string Ovlasteno_Lice;
public string Name
{
get{return ovlasteno_Lice; }
set{ ovlasteno_Lice = value;}
}
public static void Podaci()
{
// Ovlasteno_Lice = Name;
SqlConnection con2 = new SqlConnection(Con);
con2.Open();
SqlCommand cmd = con2.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select ovlasteno_lice from dbo.podaci_o_korisniku";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
foreach (DataRow dr in dt.Rows)
{
ovlasteno_lice.Items.Add(dr["ovlasteno_lice"].ToString());
}
con2.Close();
}
}
}
Goran Bibic
22-Nov-19 5:20am
View
Not that. Another recommandition?
Thank you
Goran Bibic
22-Nov-19 5:19am
View
Need to select from database table Customer customer_name
Later across app to use customer_name from that class
Goran Bibic
19-Nov-19 6:33am
View
Thank you
Goran Bibic
10-Nov-19 12:28pm
View
Need for all partners x1.poslovni_partner
This code result is just 1 or need to be issnul to update other
Goran Bibic
10-Nov-19 12:23pm
View
I try this and work but just 1 row x1.poslovni_partner
Poslovni partner Ulaz [BP] Ulaz [P] Ulaz [SP] Izlaz [BP] Izlaz[P] Izlaz [SP]
Servis i prodaja STYLUS S.P. 142.50 24.23 166.73 2926.64 497.53 3424.17
Need to be multiple ROW
select x1.poslovni_partner as 'Poslovni partner',
CONVERT(decimal(16,2),(x1.Nabavka-(x1.Nabavka*14.5299/100))) AS 'Ulaz [BP]',
CONVERT(decimal(16,2),x1.Nabavka*14.5299/100) AS 'Ulaz [P]',
CONVERT(decimal(16,2),Nabavka) AS 'Ulaz [SP]',
CONVERT(decimal(16,2),Izdavanje-(Izdavanje*14.5299/100)) AS 'Izlaz [BP]',
CONVERT(decimal(16,2),Izdavanje*14.5299/100) AS 'Izlaz[P]',
CONVERT(decimal(16,2),Izdavanje) AS 'Izlaz [SP]'
from(select poslovni_partner, SUM(iznos_sa_porezom) as Nabavka
from(select poslovni_partner, iznos_sa_porezom from mp_ulazni_racun_roba_lista union all
select poslovni_partner, iznos_sa_porezom from mp_ulazni_racun_ostalo_lista union all
select poslovni_partner, iznos_sa_porezom from mp_ulazni_racun_repromaterijal_lista) a
group by poslovni_partner) x1
LEFT join(select kupac, SUM(iznos_sa_pdv) as Izdavanje
from(select kupac, iznos_sa_pdv from mp_racun_lista union all
select kupac, iznos_sa_pdv from mp_faktura_lista union all
select kupac as poslovni_partner, iznos_sa_pdv as iznos_sa_pdv from vp_faktura_lista) b
group by kupac) x2
on x1.poslovni_partner = x2.kupac
Goran Bibic
10-Nov-19 9:59am
View
Now is updated by Richard MacCutchan
Error is Msg 8120, Level 16, State 1, Line 44
Column 'mp_ulazni_racun_roba_lista.poslovni_partner' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Goran Bibic
5-Nov-19 11:37am
View
I solve!
if (Memorandum == null)
{
MessageBox.Show("Please update pics ", "Informacija", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
...print document
Thank you
Goran Bibic
5-Nov-19 11:21am
View
In this case have error here
iTextSharp.text.Image logo = iTextSharp.text.Image.GetInstance(Memorandum);
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Goran Bibic
5-Nov-19 11:17am
View
We can put some message box ...Please read picture...
Goran Bibic
5-Nov-19 11:15am
View
Here have error if is null
if (!reader14.IsDBNull(0)) ///here Error is System.InvalidOperationException: 'Invalid attempt to read when no data is present.'
{
Memorandum = (byte[])reader14[0];
}
else
{
Memorandum = null;
}
Goran Bibic
5-Nov-19 11:08am
View
Or some message box ...Please read picture...
Goran Bibic
5-Nov-19 11:04am
View
No problem. If is null, show document without image. Now have errof if is null
Somesting like
Memorandum=empty;
Or like that
Goran Bibic
5-Nov-19 10:58am
View
This work fine...just addititional question
Iff iss null?
if (reader14[0] != null && reader14[0] != DBNull.Value)
{
Memorandum = (byte[])reader14[0];
}
else
{
Memorandum = ????
}
Goran Bibic
5-Nov-19 10:51am
View
Thank you
Goran Bibic
2-Nov-19 9:31am
View
I am solve
reader8 = cmd8.ExecuteReader();
while (reader8.Read())
{
if (reader8[0] != null && reader8[0] != DBNull.Value)
{
redni_broj = reader8.GetString(0);
}
else
{
redni_broj = " -----";
}
}
openCon8.Close();
And work
Goran Bibic
2-Nov-19 9:23am
View
If put value in db 1 result is 00001
If put value ind db null result is empty (need to be -----)
Goran Bibic
2-Nov-19 8:59am
View
1. What data type is redni_broj? int
What is the actual value? acutal is null
2. What does this function currently return? curently if is null (empty), if have value exmp 1 (write 00001)
Are there errors? No have errors
Goran Bibic
2-Nov-19 8:57am
View
reader8 = cmd8.ExecuteReader();
redni_broj = reader8.Read() ? reader8[0].ToString() : "-----";
This dont work result is null
Goran Bibic
28-Oct-19 9:33am
View
Why hapeend that? For all my apps...yesterday was to be ok
Goran Bibic
28-Oct-19 9:32am
View
Colunm exist and column name iz oznaka
When change all to oznaka work fine
Goran Bibic
28-Oct-19 8:10am
View
TextBox, combo box and other thing are ok.
Problem is sql query.
Error is..column not exist Oznaka.
When change to oznaka work all ok.
But why happend that?
I must repair complete app
Goran Bibic
25-Oct-19 4:53am
View
private System.Windows.Forms.ComboBox godinaComboBox;
change to
public System.Windows.Forms.ComboBox godinaComboBox;
but it is the same
Goran Bibic
2-Oct-19 3:58am
View
Not working this Connect Timeout=120, after 30 second write error
Goran Bibic
2-Oct-19 3:05am
View
Need to setup conection life time or Conection time out
Goran Bibic
25-Jul-19 5:10am
View
Why files? Need conn string to db?
Goran Bibic
25-Jul-19 5:09am
View
Now I want to do that
Goran Bibic
22-Jul-19 6:36am
View
Need to implement you solution here
//Adding DataRow
foreach (DataGridViewRow row in AnalitickaKarticaPartneraDataGridView.Rows)
{
int c = 0;
int d = 0;
foreach (DataGridViewCell cell in row.Cells)
{
if (c == 2 && d == 3)
{
PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString().Split(' ')[0], calibri));
pdfTable.AddCell(cell2);
}
else
{
PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString(), calibri));
pdfTable.AddCell(cell2);
}
c++;
d++;
}
}
Goran Bibic
22-Jul-19 5:54am
View
How to implement this in my code?
Goran Bibic
14-Jul-19 7:21am
View
Yeah. Need example
Goran Bibic
13-Jul-19 5:18am
View
Thank you
Goran Bibic
13-Jul-19 5:02am
View
This is type work
'404-Nivelacija MPC - " + redni_brojListaTextBox.Text + "/" + DateTime.Now.Year + "'
This is type I need
'404-Nivelacija MPC - " + (select max(redni_broj) from dbo.nivelacije_lista) + "/" + DateTime.Now.Year + "'
Goran Bibic
6-Jul-19 11:31am
View
https://www.youtube.com/watch?v=Q_JxpGzhNqQ ... need this BUT for pdf
Why you write if you don't now answer on my question?
Goran Bibic
6-Jul-19 11:30am
View
https://www.youtube.com/watch?v=Q_JxpGzhNqQ ... need this BUT for pdf
Goran Bibic
6-Jul-19 8:42am
View
Ok. NEED TO read FROM FIRST PAGE pdf document TO TEXTBOX SPECIFIED from specified LOCATION 420X120, SIZE reading RECTANGLE 80x80....Is question now corect?
Goran Bibic
6-Jul-19 8:42am
View
Ok. NEED TO read FROM FIRST PAGE pdf document TO TEXTBOX SPECIFIED from specified LOCATION 420X120, SIZE reading RECTANGLE 80x80....Is question now corect?
Goran Bibic
4-Jul-19 3:23am
View
NEED TO SCAN FROM FIRST PAGE TO TEXTBOX SPECIFIED LOCATION 420X120 SIZE RECTANGLE 80x80....What is not clear?
Goran Bibic
4-Jul-19 3:23am
View
NEED TO SCAN FROM FIRST PAGE TO TEXTBOX SPECIFIED LOCATION 420X120 SIZE RECTANGLE 80x80....What is not clear?
Goran Bibic
3-Jul-19 7:05am
View
Code work, but for complete page. Need help for exmple rectangle ona page on specific location to scan values an put into textbox. Understand?
Goran Bibic
3-Jul-19 7:04am
View
Razumijem, ja sve drug moj. Ovo je kod za cijelu stranicu, Meni treba kod za neki rectangle koji ce skenirati tacno oznaceni dio samo na prvoj stranici. Ostale mi nisu bitne
Goran Bibic
2-Jul-19 11:03am
View
Just first page
Goran Bibic
2-Jul-19 11:03am
View
Reader text of the PDF...sory
Goran Bibic
24-Mar-19 12:21pm
View
Thank you
Goran Bibic
24-Mar-19 11:07am
View
Thank you. Solved
Goran Bibic
19-Mar-19 2:17am
View
Need to copy row from one datagridview to another
Goran Bibic
18-Mar-19 13:53pm
View
Ok. Recomandioton? Solution? Help
Goran Bibic
22-Feb-19 7:22am
View
What to chose? When have situation:
bar_code 123456 IsDigit (this is ok and work quatity + 1)
bar_code VM123456 IsLetterOrDigit (this add new row with same item and quatity 1)
Some recomandition?
Goran Bibic
22-Jan-19 2:42am
View
Yes. Thats right. Data is in datagrid, just need to add on invoice
Data column on Datagrid rows are number, name, tax and price
Goran Bibic
21-Jan-19 12:57pm
View
private static void PrintReceiptPage
Here need to put values number, name, tax and price from datagrid
Some help?
Goran Bibic
16-Jan-19 5:42am
View
Need to scan marked field on pdf document and insert into database from texbox scaned values
Goran Bibic
29-Dec-18 4:19am
View
I know. Have half finished solution. Must repair. To add new column with type numeric in sql table? And visual studio...etc...Right?
Goran Bibic
29-Dec-18 4:06am
View
I try to solve the problem, men work before me in this company
Goran Bibic
29-Dec-18 3:49am
View
datatype is varchar (255)
Goran Bibic
29-Dec-18 3:27am
View
Thank you. Regards
Goran Bibic
29-Dec-18 3:14am
View
Not understand my question.
Value is null sql write 0 that is ok
Value is 500.00 sql write 500.00 its ok
Problem is when have values bigger then 999 with separator , 1,456.00
When is sum in sql 500.00+1,456.00 result is 500.00
Separator , is problem
Some help?
Goran Bibic
5-Dec-18 12:28pm
View
Some code? Or you can edit my code
Goran Bibic
4-Dec-18 5:06am
View
Yes. That. Need some code. Instruction...
Goran Bibic
22-Oct-18 11:37am
View
No help?
Goran Bibic
21-Oct-18 8:11am
View
Second question, I have existing datagrid with values bar_kod, ime, cijena_sa_porezom.
Why this?
GLOBALVARS.dt = new DataTable();
if (GLOBALVARS.dt.Columns.Count == 0)
{
GLOBALVARS.dt.Columns.Add("bar_kod");
GLOBALVARS.dt.Columns.Add("ime");
GLOBALVARS.dt.Columns.Add("cijena_sa_porezom");
}
Goran Bibic
21-Oct-18 7:55am
View
Its work, just one simple proble. Just one row add in datagrid. If have two thing have just one row and change things?
Need if have 5 things, to be 5 rows. If have thing just ++ quatity. Hope to understand?
Goran Bibic
21-Oct-18 4:31am
View
Deleted
I putt this code in textbox key down. When put value of bar code not insert in datagrid?
Goran Bibic
20-Oct-18 9:02am
View
What is GLOBALVARS? Error...how to define that?
Goran Bibic
19-Oct-18 17:10pm
View
Yes, if is bar_code ok, insert values in datagrid1
I try this, just read, no insert in datagreid1
private void prijavaAction()
{
{
SqlConnection con = new SqlConnection(cs);
if (textBox1.Text.All(char.IsDigit))
{
string queryString = "select bar_kod, ime, cijena_sa_porezom from roba_usluge WHERE bar_kod = '" + textBox1.Text + "'";// pronaci radnika u bazi
using (SqlConnection connection = new SqlConnection(cs))
{
SqlCommand command = new SqlCommand(queryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
dataGridView1.Rows[i].Cells["bar_kod"].Value = reader["bar_kod"].ToString();
dataGridView1.Rows[i].Cells["naziv_artikla"].Value = reader["ime"].ToString();
dataGridView1.Rows[i].Cells["cijena"].Value = reader["cijena_sa_porezom"].ToString();
}
reader.Close();
}
else
{
MessageBox.Show("Bar kod ne postoji!", "Obavještenje", MessageBoxButtons.OK, MessageBoxIcon.Information);
textBox1.Text = "";
}
}
}
else
{
MessageBox.Show("Bar kod ne postoji!", "Obavještenje", MessageBoxButtons.OK, MessageBoxIcon.Information);
textBox1.Text = "";
}
}
}
Goran Bibic
19-Oct-18 17:07pm
View
I try this but just read...no insert in datagridviuew1
private void prijavaAction() //04.04. final doradjena perfect
{
{
SqlConnection con = new SqlConnection(cs);
if (textBox1.Text.All(char.IsDigit))
{
string queryString = "select bar_kod, ime, cijena_sa_porezom from roba_usluge WHERE bar_kod = '" + textBox1.Text + "'";// pronaci radnika u bazi
using (SqlConnection connection = new SqlConnection(cs))
{
SqlCommand command = new SqlCommand(queryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
dataGridView1.Rows[i].Cells["bar_kod"].Value = reader["bar_kod"].ToString();
dataGridView1.Rows[i].Cells["naziv_artikla"].Value = reader["ime"].ToString();
dataGridView1.Rows[i].Cells["cijena"].Value = reader["cijena_sa_porezom"].ToString();
}
reader.Close();
}
else
{
MessageBox.Show("Bar kod ne postoji!", "Obavještenje", MessageBoxButtons.OK, MessageBoxIcon.Information);
textBox1.Text = "";
}
}
}
else
{
MessageBox.Show("Bar kod ne postoji!", "Obavještenje", MessageBoxButtons.OK, MessageBoxIcon.Information);
textBox1.Text = "";
}
}
}
Goran Bibic
19-Oct-18 16:57pm
View
Not display in datagrid...need to check ,,WHERE bar_kod = '" + textBox1.Text,,
if have to insert in datagrid
Some help?
Goran Bibic
19-Oct-18 16:32pm
View
I try thi
private void prijavaAction() //04.04. final doradjena perfect
{
{
SqlConnection con = new SqlConnection(cs);
if (textBox1.Text.All(char.IsDigit))
{
string queryString = "select bar_kod, ime,pakovanje, porez_procenat,cijena_sa_porezom from roba_usluge WHERE bar_kod = '" + textBox1.Text + "'";// pronaci radnika u bazi
using (SqlConnection connection = new SqlConnection(cs))
{
SqlCommand command = new SqlCommand(queryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
//insert into datagrid1
}
else
{
MessageBox.Show("Bar kod not exist!", "Obavještenje", MessageBoxButtons.OK, MessageBoxIcon.Information);
textBox1.Text = "";
}
}
}
Goran Bibic
15-Oct-18 1:49am
View
I try this, but when is valuee null from sql nothing hapend, I need 0.00 when is null
private void ukupno_bez_pdv_usluge()
{
SqlConnection con2 = new SqlConnection(cs);
string sqlquery = ("SELECT SUM(isnull(cast(REPLACE(TRY_CONVERT(int,TRY_CONVERT(float,iznos_bpdv),1), '#,0.00','')AS decimal(10,2)),0.00)) as UKUPNObpdv," +
" SUM(isnull(cast(REPLACE(TRY_CONVERT(float, TRY_CONVERT(float, pdv), 1), '#,0.00', '')AS decimal(10, 2)), 0.00)) as UKUPNOpdv," +
" SUM(isnull(cast(REPLACE(TRY_CONVERT(float, TRY_CONVERT(float, mp_cijena), 1), '#,0.00', '')AS decimal(10, 2)), 0.00)) as UKUPNOsapdv" +
" from mp_racun_roba" +
" where tip_robe = 'Usluge (Generalno)' and id_fakture =" + id_fakture
);
SqlCommand command = new SqlCommand(sqlquery, con2);
con2.Open();
SqlDataReader sdr = command.ExecuteReader();
if (sdr.Read())
{
usluga_bez_pdvTextBox.Text = sdr["UKUPNObpdv"].ToString();
usluga_pdvTextBox.Text = sdr["UKUPNOpdv"].ToString();
usluga_sa_pdvTextBox.Text = sdr["UKUPNOsapdv"].ToString();
}
else
{
usluga_bez_pdvTextBox.Text = "0.00";
usluga_pdvTextBox.Text = "0.00";
usluga_sa_pdvTextBox.Text = "0.00";
}
con2.Close();
}
Goran Bibic
15-Oct-18 1:13am
View
My code working fine. When result have value its ok.
Need when result is NULL to write 0.00
Some help?
Goran Bibic
5-Oct-18 5:21am
View
Solved. Thank you
Goran Bibic
5-Oct-18 5:03am
View
prijava_radnika.VrijemePrijave have values exp. 06,11,23...etc (date of the month)
Goran Bibic
22-Sep-18 1:57am
View
This work, but that is for one column people...I NEED FOR MULTIPLE COLUMN SIX TIMES WRITE.THANK YOU
Goran Bibic
21-Sep-18 10:32am
View
Column number 2 work in my code. I need 3 column date type
i try this
foreach (DataGridViewRow row in mp_racun_listaDataGridView.Rows)
{
int c = 0;
foreach (DataGridViewCell cell in row.Cells)
{
if (c == 2)
{
PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString().Split(' ')[0], calibri));
pdfTable.AddCell(cell2);
}
else
{
PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString(), calibri));
pdfTable.AddCell(cell2);
}
c++;
}
int d = 0;
foreach (DataGridViewCell cell in row.Cells)
{
if (d == 3)
{
PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString().Split(' ')[0], calibri));
pdfTable.AddCell(cell2);
}
else
{
PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString(), calibri));
pdfTable.AddCell(cell2);
}
d++;
}
}
And this
int c = 0;
int d = 0;
foreach (DataGridViewCell cell in row.Cells)
{
if (c == 2 && d==3)
{
PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString().Split(' ')[0], calibri));
pdfTable.AddCell(cell2);
}
else
{
PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString(), calibri));
pdfTable.AddCell(cell2);
}
c++;
d++;
}
Goran Bibic
21-Sep-18 2:10am
View
Yes
Goran Bibic
21-Sep-18 1:43am
View
No
Goran Bibic
20-Sep-18 11:21am
View
Of course...one column work...multiple dont work...some help...not critics before read the question...Thanks Alek Massey
Goran Bibic
7-Sep-18 15:31pm
View
Animation play...like on video...some examples
Goran Bibic
7-Sep-18 15:30pm
View
Need some examples...I posted video...sory...thank you
Goran Bibic
7-Sep-18 15:07pm
View
Video play numbers? Or some solution like on video?
Goran Bibic
7-Sep-18 15:05pm
View
random number generator is question. How to create an play?
Goran Bibic
6-Sep-18 5:35am
View
Thank you
Goran Bibic
6-Sep-18 2:07am
View
Thank you
Goran Bibic
4-Sep-18 15:54pm
View
Solved...thanks for help
Goran Bibic
4-Sep-18 15:03pm
View
Maybe. Good solution
Goran Bibic
4-Sep-18 14:32pm
View
I choose one conection when login. Hot to apply for all app that conn string when login whit him?
Goran Bibic
4-Sep-18 14:30pm
View
I need some recommendation
Goran Bibic
4-Sep-18 14:22pm
View
string cs = comoBox.SelectedIndex == 1 ? connectionString2018 : connectionString2017;
Where to put this?
namespace test_2017_2018
{
public partial class Form1 : Form
{
//string cs = "Data Source=.\\SQLEXPRESS;Initial Catalog=2017;Integrated Security=True";
string cs = comboBox1.SelectedIndex == 1 ? test_2017_2018.Properties.Settings.TEST_2018 : test_2017_2018.Properties.Settings.TEST_2017;
public Form1()
{
InitializeComponent();
comboBox1.DataSource = GetDatabaseList(cs);
}
Goran Bibic
4-Sep-18 14:21pm
View
My friend. I now elementary statement. Exmpl(if selected_index==1 selected is 2017, else 2018 etc...but what when login in app? When string app use?
Goran Bibic
4-Sep-18 14:08pm
View
I need when login in app to to use that selected conn string.
Goran Bibic
4-Sep-18 14:04pm
View
That will be for all app when login?
Goran Bibic
4-Sep-18 14:02pm
View
Yes. What to put in if statement?
Goran Bibic
4-Sep-18 14:01pm
View
Deleted
Yes. What to put in if statement?
Goran Bibic
4-Sep-18 13:48pm
View
When choose 2017 to use that conn string, when chose 2018 to use that conn string
Goran Bibic
4-Sep-18 13:48pm
View
I want to log in to the application, on Form1 to select the combobox(2017 or 2018)and to use that conn string
Some help?
Goran Bibic
4-Sep-18 13:36pm
View
Same server, Yes, Yes(but if there is a better solution suggest),Microsoft SQL 2016.
Goran Bibic
4-Sep-18 13:24pm
View
Thank you so much....if you have time you can look this question...thank you
https://www.codeproject.com/Questions/1258926/Select-values-from-diferent-db-with-same-app-Cshar
Goran Bibic
4-Sep-18 13:12pm
View
Thank you men...alot
Goran Bibic
4-Sep-18 12:49pm
View
1) Its default windows photo picture and its ok
2) No (Image is saved in db)
3) Yes
Goran Bibic
4-Sep-18 12:38pm
View
Something like PathofFile= picturebox.value
Goran Bibic
4-Sep-18 12:36pm
View
Ok. Look. I have picture upload in picture box and save in database. OK?
Now when I click on row in datagrid I see picture in picture box.
Everything working fine.
Now I need that picture (from database) in picture box whit button to open in windows picture and fax viuwer ok?
Goran Bibic
4-Sep-18 12:31pm
View
Process.Start("C:\windows\system32\rundll32.exe", "C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " & PathOfFile);
This solution is ok, how to define PathOfFile?
Help
Goran Bibic
4-Sep-18 12:25pm
View
I have picture in picturebox. Retrieved from database
Just need to show picture from picture box to Windows photo viuwer
Goran Bibic
4-Sep-18 12:21pm
View
Code no have errors, but in app when click on button :
The system cant find file specified!
Goran Bibic
4-Sep-18 12:19pm
View
new Process().Start(@"c:\\testImage.jpg");
Severity Code Description Project File Line Suppression State
Error CS0176 Member 'Process.Start(string)' cannot be accessed with an instance reference; qualify it with a type name instead
Goran Bibic
4-Sep-18 12:10pm
View
private void button12_Click(object sender, EventArgs e)
{
new Process.Start(@"c:\\testImage.jpg");
}
error is Severity Code Description Project File Line Suppression State
Error CS0426 The type name 'Start' does not exist in the type 'Process'
Goran Bibic
2-Sep-18 9:15am
View
Thank you
Goran Bibic
21-Aug-18 3:11am
View
I have app, need to use data from datababe mks_2017 (for 2017. year) and from database mks_2018 (data from 2018. year). When login to chose from combobox database I want to use
Goran Bibic
21-Aug-18 3:09am
View
Recomandition? Some help?
Goran Bibic
6-Aug-18 13:37pm
View
How to retrieve from db?
I try this...but somesthing wrong...file pdf
Other textbox and combo box values are ok
private void DocumentsDataGridView_SelectionChanged(object sender, EventArgs e)
{
if (documentsDataGridView.SelectedRows.Count > 0)
{
string id = documentsDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn1"].Value.ToString();
string number = documentsDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn2"].Value.ToString();
string count_number = documentsDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn3"].Value.ToString();
string label = documentsDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn4"].Value.ToString();
string partner = documentsDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn5"].Value.ToString();
string tax_number = documentsDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn6"].Value.ToString();
string file_location = documentsDataGridView.SelectedRows[0].Cells["file_location"].Value.ToString();
idTextBox.Text = id;
numberTextBox.Text = number;
count_numberTextBox.Text = count_number;
labelTextBox.Text = label;
partnerComboBox.Text = partner;
tax_numberTextBox.Text = tax_number;
dateDateTimePicker.Value = Convert.ToDateTime(documentsDataGridView.SelectedRows[0].Cells["dataGridViewTextBoxColumn7"].Value);
file_locationTextBox.Text = file_location;
try
{
if (documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value != null)
{
//FileStream fs = File.OpenRead(ofd.FileName);
//MemoryStream ms = new MemoryStream();
//fs.CopyTo(ms);
//byte[] ap = (byte[])(documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value);
//MemoryStream ms = new MemoryStream(ap);
//axAcroPDF1.src = LocalEncoding.GetString(ms.ToArray());
//axAcroPDF1.LoadFile(ms);
// //// pictureBox.Image = ConvertBinaryToImage(list[listView.FocusedItem.Index].Data);
// byte[] ap = (byte[])(documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value);
// MemoryStream ms = new MemoryStream(ap);
// ms.Position = 0;
// File.WriteAllBytes(@"C:\PDFs.pdf", ms.ToArray());
// //Process.Start(@"C:\PDFs.pdf");
// axAcroPDF1.LoadFile(@"C:\PDFs.pdf");
// axAcroPDF1.Enabled = true;
// SqlConnection connection = new SqlConnection(cs);
// connection.Open();
// SqlCommand command = new
// SqlCommand("select pdf_file from documents where id=" + idTextBox.Text, connection);
// byte[] buffer = (byte[])command.ExecuteScalar();
// connection.Close();
// FileStream fs = new FileStream(@"C:\PDFs\test.pdf", FileMode.Create);
// //fs.Write(buffer, 0, buffer.Length);
// //fs.Close();
//axAcroPDF1.LoadFile(@"C:\PDFs\test.pdf");
//axAcroPDF1.Enabled = true;
}
else
{
axAcroPDF1.src = null;
}
}
catch
{
axAcroPDF1.src = null;
}
//SqlConnect
Goran Bibic
6-Aug-18 13:35pm
View
I solve that and work...just need help to retrieve from db.
Save like this
private void Button2_Click(object sender, EventArgs e) //Save //snimi
{
OpenFileDialog ofd = new OpenFileDialog() { Filter = "PDF|*.pdf" };//Open pdf file
if (ofd.ShowDialog() == DialogResult.OK)
{
FileStream fs = File.OpenRead(ofd.FileName);
MemoryStream ms = new MemoryStream();
axAcroPDF1.src = LocalEncoding.GetString(ms.ToArray());
fs.CopyTo(ms);
if (count_numberTextBox.Enabled == true)
{
if (string.IsNullOrEmpty(idTextBox.Text))
{
using (SqlConnection openCon = new SqlConnection(cs))
{
string saveStaff = "declare @maxNo integer = 0 select @maxNo = isnull(max(number), 0) from [dbo].[documents]; Set @maxNo=@maxNo+1; INSERT into dbo.documents (number, count_number, label, partner, tax_number, date, file_location, pdf_file) VALUES (@maxNo,@count_number,@label,@partner,@tax_number,@date,@file_location,@pdf_file)";
using (SqlCommand querySaveStaff = new SqlCommand(saveStaff))
{
querySaveStaff.Connection = openCon;
querySaveStaff.Parameters.Add("@count_number", SqlDbType.VarChar, 255).Value = count_numberTextBox.Text;
querySaveStaff.Parameters.Add("@label", SqlDbType.VarChar, 255).Value = labelTextBox.Text;
querySaveStaff.Parameters.Add("@partner", SqlDbType.VarChar, 255).Value = partnerComboBox.Text;
querySaveStaff.Parameters.Add("@tax_number", SqlDbType.VarChar, 255).Value = tax_numberTextBox.Text;
querySaveStaff.Parameters.Add("@date", SqlDbType.Date).Value = dateDateTimePicker.Text;
querySaveStaff.Parameters.Add("@file_location", SqlDbType.VarChar, 255).Value = file_locationTextBox.Text;
querySaveStaff.Parameters.AddWithValue("@pdf_file", SqlDbType.VarBinary).Value = ms.ToArray();
openCon.Open();
querySaveStaff.ExecuteNonQuery();
openCon.Close();
dateDateTimePicker.Enabled = false;
count_numberTextBox.Enabled = false;
file_locationTextBox.Enabled = false;
labelTextBox.Enabled = false;
partnerComboBox.Enabled = false;
tax_numberTextBox.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
}
}
}
else
{
using (SqlConnection openCon = new SqlConnection(cs))
{
string saveStaff = "UPDATE dbo.documents SET count_number=@count_number, label=@label, partner=@partner, tax_number=@tax_number, date=@date, file_location=@file_location, pdf_file=@pdf_file WHERE id= " + idTextBox.Text;
using (SqlCommand querySaveStaff = new SqlCommand(saveStaff))
{
querySaveStaff.Connection = openCon;
querySaveStaff.Parameters.Add("@count_number", SqlDbType.VarChar, 255).Value = count_numberTextBox.Text;
querySaveStaff.Parameters.Add("@label", SqlDbType.VarChar, 255).Value = labelTextBox.Text;
querySaveStaff.Parameters.Add("@partner", SqlDbType.VarChar, 255).Value = partnerComboBox.Text;
querySaveStaff.Parameters.Add("@tax_number", SqlDbType.VarChar, 255).Value = tax_numberTextBox.Text
Goran Bibic
6-Aug-18 13:15pm
View
Some help?
Goran Bibic
6-Aug-18 3:15am
View
Yes. That is question. Why in db write just 0x
When put picture have 0xFFD8FFE000104A46494600010101000000000000FFE2021C4943435F50524F........
And I can read from db file
Ok?
Goran Bibic
6-Aug-18 3:15am
View
Yes. That is question. Why in db write just 0x
When put picture have 0xFFD8FFE000104A46494600010101000000000000FFE2021C4943435F50524F........
And I can read from db file
Ok?
Goran Bibic
2-Aug-18 5:22am
View
I try to find and just this in debuger. Where to find errors?
Goran Bibic
2-Aug-18 4:44am
View
'DMS 2018.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\Bibic Goran\source\repos\DMS 2018\DMS 2018\bin\Debug\DMS 2018.exe'. Symbols loaded.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\Users\Bibic Goran\source\repos\DMS 2018\DMS 2018\bin\Debug\AxInterop.AcroPDFLib.dll'. Module was built without symbols.
'DMS 2018.exe' (CLR v4.0.30319: DMS 2018.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll'. Skipped loading symbols. Module is opt
Goran Bibic
2-Aug-18 4:23am
View
If I good find error
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Goran Bibic
2-Aug-18 3:27am
View
Insert into
private void Button2_Click(object sender, EventArgs e) //Save //snimi
{
byte[] filedata = null;
MemoryStream ms = new MemoryStream();
filedata = ms.GetBuffer();
axAcroPDF1.src = LocalEncoding.GetString(ms.ToArray());
if (count_numberTextBox.Enabled == true)
{
if (string.IsNullOrEmpty(idTextBox.Text))
{
using (SqlConnection openCon = new SqlConnection(cs))
{
string saveStaff = "declare @maxNo integer = 0 select @maxNo = isnull(max(number), 0) from [dbo].[documents]; Set @maxNo=@maxNo+1; INSERT into dbo.documents (number, count_number, label, partner, tax_number, date, file_location, pdf_file) VALUES (@maxNo,@count_number,@label,@partner,@tax_number,@date,@file_location,@pdf_file)";
using (SqlCommand querySaveStaff = new SqlCommand(saveStaff))
{
querySaveStaff.Connection = openCon;
querySaveStaff.Parameters.Add("@count_number", SqlDbType.VarChar, 255).Value = count_numberTextBox.Text;
querySaveStaff.Parameters.Add("@label", SqlDbType.VarChar, 255).Value = labelTextBox.Text;
querySaveStaff.Parameters.Add("@partner", SqlDbType.VarChar, 255).Value = partnerComboBox.Text;
querySaveStaff.Parameters.Add("@tax_number", SqlDbType.VarChar, 255).Value = tax_numberTextBox.Text;
querySaveStaff.Parameters.Add("@date", SqlDbType.Date).Value = dateDateTimePicker.Text;
querySaveStaff.Parameters.Add("@file_location", SqlDbType.VarChar, 255).Value = file_locationTextBox.Text;
//querySaveStaff.Parameters.Add("@pdf_file", SqlDbType.VarChar, 255).Value = partner_typeComboBox.Text;
querySaveStaff.Parameters.AddWithValue("@pdf_file", SqlDbType.VarBinary).Value = filedata;
openCon.Open();
querySaveStaff.ExecuteNonQuery();
openCon.Close();
dateDateTimePicker.Enabled = false;
count_numberTextBox.Enabled = false;
file_locationTextBox.Enabled = false;
labelTextBox.Enabled = false;
partnerComboBox.Enabled = false;
tax_numberTextBox.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
}
}
}
else
{
using (SqlConnection openCon = new SqlConnection(cs))
{
string saveStaff = "UPDATE dbo.documents SET count_number=@count_number, label=@label, partner=@partner, tax_number=@tax_number, date=@date, file_location=@file_location, pdf_file=@pdf_file WHERE id= " + idTextBox.Text;
using (SqlCommand querySaveStaff = new SqlCommand(saveStaff))
{
querySaveStaff.Connection = openCon;
querySaveStaff.Parameters.Add("@count_number", SqlDbType.VarChar, 255).Value = count_numberTextBox.Text;
querySaveStaff.Parameters.Add("@label", SqlDbType.VarChar, 255).Value = labelTextBox.Text;
querySaveStaff.Parameters.Add("@partner", SqlDbType.VarChar, 255).Value = partnerComboBox.Text;
querySaveStaff.Parameters.Add("@tax_number", SqlDbType.VarChar, 255).Value = tax_numberTextBox.Text;
querySaveStaff.Parameters.Add("@date", SqlDbType.Date).Value = dateDateTimePicker.Text;
querySaveStaff
Goran Bibic
2-Aug-18 3:26am
View
Table query
/****** Object: Table [dbo].[documents] Script Date: 2.8.2018. 09:25:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[documents](
[id] [int] IDENTITY(1,1) NOT NULL,
[number] [int] NULL,
[count_number] [varchar](255) NULL,
[label] [varchar](255) NULL,
[partner] [varchar](255) NULL,
[tax_number] [varchar](255) NULL,
[date] [date] NULL,
[file_location] [varchar](255) NULL,
[pdf_file] [varbinary](max) NULL,
CONSTRAINT [PK_documents] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
Goran Bibic
2-Aug-18 2:56am
View
Not work that is error
Goran Bibic
2-Aug-18 2:56am
View
The folowing exception occured in the DataGridView
System.ArgumentException: Parameter not valid. at system.Drawing.Image.FromStream(Stream stream, Boolean validateImageData)
That is short error text. But why Drawing image when I insert PDF in database and I wan to retrieve pdf in axAcroPDF1
I try this
byte[] ap = (byte[])(documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value);
MemoryStream ms = new MemoryStream(ap);
ms.Position = 0;
File.WriteAllBytes(@"C:\PDFs.pdf", ms.ToArray());
Process.Start(@"C:\PDFs.pdf");
Goran Bibic
2-Aug-18 2:34am
View
I have error now...how to post picture?
Goran Bibic
2-Aug-18 1:48am
View
I try this
byte[] ap = (byte[])(documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value);
MemoryStream ms = new MemoryStream(ap);
ms.Position = 0;
File.WriteAllBytes(@"D:\mypdf.pdf", ms.ToArray());
Process.Start(@"D:\mypdf.pdf");
Dont work
Goran Bibic
31-Jul-18 4:17am
View
I read I try...but no have result...I need help to solve that... Thank you
Goran Bibic
31-Jul-18 3:54am
View
Idea is:
If have pdf to show him in axAcroPDF1
If dont have axAcroPDF1.src = null;
Some help?
Goran Bibic
28-Jul-18 9:26am
View
To read from an URL try this:
using(WebClient client = new WebClient()) {
string s = client.DownloadString(url);
}
Instead URL use this
https://drive.google.com/open?id=0B5ZQZ7etv3XpaEZpYlBXcUlOXYZ
?
Goran Bibic
28-Jul-18 9:24am
View
OK.I will try
Goran Bibic
28-Jul-18 9:10am
View
"C:\Users\test\Google Drive"
Maybe that?
Becose I have on every PC that folder, I first scan documents to pdf in that folder and then insert and read from app
Goran Bibic
28-Jul-18 8:58am
View
Some solution like read from String path(file_locationTextBox.Text)
Goran Bibic
28-Jul-18 8:58am
View
Some solution like read from String path(file_locationTextBox.Text)
Goran Bibic
28-Jul-18 8:56am
View
Some help?
Goran Bibic
28-Jul-18 8:56am
View
Some help?
Goran Bibic
28-Jul-18 8:56am
View
Insert file locattion in sql
querySaveStaff.Parameters.Add("@file_location", SqlDbType.VarChar, 255).Value = file_locationTextBox.Text;
How to retrieve file from some location?
I try on datagrid selection changes but not succesfull
//byte[] bt;
try
{
if (documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value != null)
{
//byte[] ap = (byte[])documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value;
//MemoryStream ms = new MemoryStream(ap);
////dataPictureBox.Image = System.Drawing.Image.FromStream(ms);
//axAcroPDF1.src = LocalEncoding.GetString(ms.ToArray());
//using (OpenFileDialog ofd = new OpenFileDialog()
//{
// ValidateNames = true, Multiselect = false, Filter = "PDF|*.pdf" }) {
// if (ofd.ShowDialog() == DialogResult.OK)
// {
// bt = null;
//MemoryStream fs = new MemoryStream(bt);
//bt = new byte[fs.Length];
// fs.Read(bt, 0, (id)fs.Length);
// axAcroPDF1.src = LocalEncoding.GetString(fs.ToArray());
//fs.Close();
// }
// }
StringBuilder text = new StringBuilder();
// using (PdfReader reader = new PdfReader("D:\\SPEDICIJA MERIDIJAN\\informacija\\SKM_28718052812170.pdf"))
using (PdfReader reader = new PdfReader("D:\\SPEDICIJA MERIDIJAN\\informacija\\SKM_28718052812170.pdf"))
{
for (int i = 1; i <= reader.NumberOfPages; i++)
{
text.Append(PdfTextExtractor.GetTextFromPage(reader, i));
}
}
// You can read from text.ToString();
//byte[] ap = (byte[])documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value;
//string tempName = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + ".pdf");
//File.WriteAllBytes(tempName, ap);
//axAcroPDF1.src = tempName;
}
else {
axAcroPDF1.src = null;
}
}
catch
{
axAcroPDF1.src = null;
}
Goran Bibic
28-Jul-18 8:56am
View
Insert file locattion in sql
querySaveStaff.Parameters.Add("@file_location", SqlDbType.VarChar, 255).Value = file_locationTextBox.Text;
How to retrieve file from some location?
I try on datagrid selection changes but not succesfull
//byte[] bt;
try
{
if (documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value != null)
{
//byte[] ap = (byte[])documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value;
//MemoryStream ms = new MemoryStream(ap);
////dataPictureBox.Image = System.Drawing.Image.FromStream(ms);
//axAcroPDF1.src = LocalEncoding.GetString(ms.ToArray());
//using (OpenFileDialog ofd = new OpenFileDialog()
//{
// ValidateNames = true, Multiselect = false, Filter = "PDF|*.pdf" }) {
// if (ofd.ShowDialog() == DialogResult.OK)
// {
// bt = null;
//MemoryStream fs = new MemoryStream(bt);
//bt = new byte[fs.Length];
// fs.Read(bt, 0, (id)fs.Length);
// axAcroPDF1.src = LocalEncoding.GetString(fs.ToArray());
//fs.Close();
// }
// }
StringBuilder text = new StringBuilder();
// using (PdfReader reader = new PdfReader("D:\\SPEDICIJA MERIDIJAN\\informacija\\SKM_28718052812170.pdf"))
using (PdfReader reader = new PdfReader("D:\\SPEDICIJA MERIDIJAN\\informacija\\SKM_28718052812170.pdf"))
{
for (int i = 1; i <= reader.NumberOfPages; i++)
{
text.Append(PdfTextExtractor.GetTextFromPage(reader, i));
}
}
// You can read from text.ToString();
//byte[] ap = (byte[])documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value;
//string tempName = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + ".pdf");
//File.WriteAllBytes(tempName, ap);
//axAcroPDF1.src = tempName;
}
else {
axAcroPDF1.src = null;
}
}
catch
{
axAcroPDF1.src = null;
}
Goran Bibic
28-Jul-18 8:53am
View
Google cloud 100 gb? Maybe that solution?
Goran Bibic
28-Jul-18 2:53am
View
WITH AllTables (roba, kolicina) AS
(
SELECT roba,kolicina FROM MP_RACUN_ROBA
UNION ALL
SELECT roba,kolicina FROM mp_faktura_roba
)
SELECT roba AS 'Naziv artikla',
SUM (cast(kolicina AS float)) AS 'Prodata kolicina'
FROM AllTables AT
INNER JOIN mp_ulazni_racun_ostalo_roba MPU ON AT.kolicina=MPU.kolicina
GROUP BY roba
Like this
Some help
Msg 209, Level 16, State 1, Line 8
Ambiguous column name 'kolicina'.
Line 8 and I need in line one more table mp_ulazni_racun_roba
Goran Bibic
23-Jul-18 1:31am
View
I use this code for insert pdf file...
byte[] filedata = null;
MemoryStream ms = new MemoryStream();
filedata = ms.GetBuffer();
axAcroPDF1.src = LocalEncoding.GetString(ms.ToArray());
insert into dbo.documents (pdf_file) VALUES (@pdf_files)
querySaveStaff.Parameters.AddWithValue("@pdf_file",SqlDbType.Binary).Value=filedata;
Is this way ok?
Goran Bibic
20-Jul-18 4:08am
View
Maybe some solution with data reader?
Goran Bibic
20-Jul-18 4:08am
View
Maybe some solution with data reader?
Goran Bibic
20-Jul-18 2:38am
View
Error is when open my app
File is not started with '%PDF-'
file:///C|/Users/PC/AppData/Local/Temp/ozcbqyu.zmu.pdf
Goran Bibic
20-Jul-18 2:35am
View
I have location of file every time when upload pdf. like
D:\SPEDICIJA MERIDIJAN\informacija\SKM2556.pdf
This is in sql database inserted when upload file.
Maybe to use that?
Instead this string tempName = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + ".pdf");
Column name in sql is file_location
Goran Bibic
19-Jul-18 8:28am
View
To find from some location? Folder some exmpl...? Just way from database? I think it is ok solution to insert in database like varbinary(MAX).
That is bad solution?
Goran Bibic
19-Jul-18 1:41am
View
I want to read file from database
datagrid selection changed
try
{
if (documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value != null)
{
byte[] ap = (byte[])documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value;
MemoryStream ms = new MemoryStream(ap);
//dataPictureBox.Image = System.Drawing.Image.FromStream(ms);
axAcroPDF1.src = LocalEncoding.GetString(ms.ToArray());
}
else {
axAcroPDF1.src = null;
}
}
catch
{
axAcroPDF1.src = null;
}
Goran Bibic
19-Jul-18 1:40am
View
But I dont have path location....I just want to read file from database
Goran Bibic
8-Jul-18 10:10am
View
Thank you for advice...some help obour my question?
Goran Bibic
6-Jul-18 14:58pm
View
Thank you
Goran Bibic
6-Jul-18 2:23am
View
Ok. Understand. Thank you. Show me teh solution for this row...
"where MONTH([vrijemeprijave]) = '" + mjeseccomboBox.Text.ToString() + "' "
Goran Bibic
4-Jul-18 4:27am
View
Just have header and empty paper...ho have datagrid
Goran Bibic
5-Jun-18 2:26am
View
Column 3 date sql data type
Goran Bibic
5-Jun-18 2:26am
View
Date is selected from SQL
Show More