15,896,557 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 dr_iton (Top 42 by date)
dr_iton
14-Oct-16 2:48am
View
"username/password" I will use only in one site (which is my site). When other people want to use that streaming they need another username and password.
According to your solution, correct me if I'm wrong, you are saying that I need to manipulate the .htaccess file or something similar.
Cheers.
dr_iton
8-Dec-15 11:39am
View
As you can see, I'm sending a parameter with stored procedure ("@ID_Field") which has an Int value so none of above suggestions works.
The parameter that I send is:
sqlCmd.Parameters.Add(new SqlParameter("@ID_Field", SqlDbType.Int));
sqlCmd.Parameters["@ID_Field"].Value = Convert.ToInt32(DDL1.SelectedValue);
Thank you
dr_iton
4-Dec-15 3:26am
View
The problem was that I never used this before, solved the problem after I added a property in the boundfield. In case that someone else has the same problem the solution is to give a property to the column of datetime:
dataformatstring="{0:dd-MM-yyyy}" HtmlEncode="false"
Cheers.
dr_iton
3-Dec-15 19:08pm
View
Ok I can return the database column in DateTime format, but I want to show that column as a short date time format in grid view DateTime.ToString("dd-MM-yyyy")
Thank you for fast reply.
Cheers
dr_iton
24-Nov-15 12:39pm
View
Yeah, that was a solution. Thank you very much mate.
Q: Why do I always find a solution here?
A: Because here are the best programmers in the world.
Cheers.
dr_iton
18-Nov-15 18:05pm
View
Thank you all, problem solved.
dr_iton
18-Nov-15 15:04pm
View
If I allow nulls in the ID_Orientation field of Subject table how to know which subjects belong to which school. So through ID_Orientation I could know the School. Do I have to add another field on SUBJECT table to know the school, like ID_School or how to solve that.
The project I'm making it manages more than one school in one municipality for example.
Thank you
dr_iton
16-Nov-15 11:01am
View
Problem solved, thank you all.
dr_iton
16-Nov-15 10:16am
View
I've got your point but the problem is that I'm populating the gridview from three tables and there must be some inner joins, If I use a boundfield, those columns are shown twice in the gridview. I can make visible=false any of boundfields but can not dissapear the values selected with stored procedure. If I'm not selecting that column the bounfield thows erros.
dr_iton
16-Nov-15 9:20am
View
I never used before an Item template and don't know the procedure how to do that.
dr_iton
11-Nov-15 6:59am
View
Yes that is my problem that I can't solve it.
Can I make a solution if I send a username as a parameter if I don't change the users first and last name, other ways the procedure shall change username and password.
dr_iton
11-Nov-15 2:32am
View
Your assumption is not correct. I use two stored procedures for different purposes. The first one is for Inserting data in table and the second one is for Updating the data.
The insertion works perfectly because if I add a new user I always take max ID value (which is primary key) of that table. While I update the data of a user I do refer to the ID of that record, but if updated user already exists with the same user data it counts again the user data and changes the username according to the number of same user data records.
As I mentioned before this must be a kind of math problems and probably I'll find a solution for it.
I got in mind your suggestion and I will give a try in that direction.
Thank you again.
dr_iton
10-Nov-15 18:30pm
View
The problem is to the ELSE condition, if the user exists the parameter @numri counts the users with the same first names and last names and it concatenates that number to the name. For example if I update the user with firstname1.lastname the parameter @numri gets the value 2 which means that that the new username gets now firstname2.lastname, this user already exists.
If I make the count like parameter @numri counts the users and gets the value 2 and I increase it to 3 which means now the updated user gets firsname3.lastaname. After this if I register a new user with same name data he also gets the same username like firstname3.lastname
The problem is here and I know that is a math problem and don't know how to solve this.
Thank you again for your fast reply.
dr_iton
10-Nov-15 18:24pm
View
The problem is to the ELSE condition, if the user exists the parameter @numri counts the users with the same first names and last names and it concatenates that number to the name. For example if I update the user with firstname1.lastname the parameter @numri gets the value 2 which means that that the new username gets now firstname2.lastname, this user already exists.
If I make the count like parameter @numri counts the users and gets the value 2 and I increase it to 3 which means now hte new user gets firsname3.lastaname. After this if I register a new user with same name data he also gets the same username like firstname3.lastname
The problem is here and I know that is a math problem and don't know how to solve this.
Thank you again for your fast reply.
dr_iton
4-Nov-15 17:25pm
View
I Solved the problem after I added another column in table IDENTIFICATION with DateTime and allowing NULL values when registering new users.
If the user logs in for the first time he will be redirected to the page that he must change the PASSWORD.
I have another problem, while the user changes his password I want to hide some menu items.
According to their role I made the menus to show like following:
<% if ((Session["Role"] != null ? (string)Session["Role"] : "") == "MasterAdmin")
{ %>
<li>
<asp:Label CssClass="menuNormal" ID="lbl_MasterAdmin" Text="MASHT" runat="server">
</li>
<% }
else if ((Session["Role"] != null ? (string)Session["Roli"] : "") == "User")
{ %>
<li>
<asp:Label CssClass="menuNormal" ID="lbl_Shkolla2" Text="User" runat="server">
</li>
<%}
Thank you again.
dr_iton
3-Nov-15 11:55am
View
I'm using a data table to check if the user exists in database. If user exists, than he can be logged in and redirected to a specific site.
When I register a user the username is firstname.lastname, if the database has an record with the same first name and last name than his username gets auto increment like firstname1.secondname and so on.
@KrunalRohit according to you, do I have to make another column in the table IDENTIFICATION about the registration time or what do you suggest.
Thank you again.
dr_iton
21-Oct-15 4:28am
View
I fixed the problem using HttpUtility.HtmlDecode();
The problem now stands by the textbox where I put the password.
How to show the text from Grid View in a textbox with TextMode="Password"
Thank you again.
dr_iton
21-Oct-15 2:45am
View
When I select a row in Grid View, a column of it has an word with a character I wrote above, for example Ç, and when I populate textboxes with those columns, these characters are not shown WYSIWYG in textbox, the special character Ç is converted in ("without spaces "& # 199).
dr_iton
14-Oct-15 12:39pm
View
Thank you mate, the problem solved and I was trying to make this query for more than 12 hours, and the proper solution is your query with a little bit change there I had to write WHERE NOT EXISTS instead WHERE EXISTS.
Thank you once again. Problem solved.
dr_iton
14-Oct-15 11:26am
View
The problem is in Sotred Procedure, I want to exclude to show the records in dropdown list where KOMUNA.ID_Komuna = PERSONI.ID_Komuna
dr_iton
14-Oct-15 11:26am
View
The problem is in Sotred Procedure, I want to exclude to show the records in dropdown list where KOMUNA.ID_Komuna = PERSONI.ID_Komuna
dr_iton
17-Jun-15 3:18am
View
I want to count all matrices members that result %2==0.
The consumer does not reaches the web service code even if I made a web service reference.
So I want see the matrices result at the consumer side.
cheers
dr_iton
26-Feb-15 17:33pm
View
My mother tongue is not English, that is the reason that you misunderstand me, or better said, there was a lack of English words from my side.
Definitely I've got the point now.
Once again thank you.
dr_iton
26-Feb-15 12:14pm
View
What I'm pretending to do is, if I give an integer value, I want to see in the array if that value is inside of arrays domain. for example:
if I'm trying to see if number 4 is inside arrays domain
Array has the following members int[] array = {-3,-1, 1, 5, 6}
so mathematically the domain for this array is (-3,6)
that means the 4 should be inside the domain.
Hopefully you got my point.
Cheers
dr_iton
16-Jun-14 6:55am
View
I'm getting an error on following row.
dt["KlasaViti"] = "--Zgjedh--";
How to solve that, and after this in the asp.net the code was that after checking the value in ddl1 it populated the ddl2 with values that was related with ddl1 ID or value.
dr_iton
30-Jan-14 18:02pm
View
yes ID_Klasa in table PARALELJA is a foreign key, so I'm creating a stored procedure and have two textboxes, in one textbox I input data for KlasaViti in table KLASA and in second textbox I input data for Paralelja in Table PARALELJA. What I intend to do is Input those data in both tables, and as you can see ID_Klasa in table KLASA and ID_Paralelja in Table PARALELJA are auto increment values. My problem is how to get ID_Klasa value form table KLASA and that value to store in column ID_klasa at PARALELJA table.
dr_iton
30-Jan-14 12:38pm
View
Take a look at my post I edited the question. So all I want is when I select a specific combination of rows from first table and second table to get the ID_Klasa and to automatically insert that in third column.
Or to be more specific. How to get ID_Klasa from table KLASA and insert that value in ID_Klasa at table PARALELJA.
dr_iton
18-Dec-13 5:33am
View
I had no positive result with that, all I want is to call class Klasa with its parameters and iniciate that so I can give values to it,
namespace ScoMan_TI.NUnit_Testing
{
[TestFixture]
class Klasa_Testuese
{
Klasa klasa;
[SetUp]
public void initKlasa()
{
//int ID_Klasa = 15;
//int KlasaViti = 12;
//int Paralelja = 5;
//KlasaDB = new KlasaDB()
//KlasaDB.Shto()
//klasa = new Klasa(new Klasa{ID_Klasa, KlasaViti, Paralelja});
}
The problem is here in this test class, how to call or iniciate the parameters of Klasa
how to call this
klasa = new Klasa (ID_Klasa, KlasaViti, Paralelja)
it tells me the no such of method exists.
Al I want is to test this method:
public static void Shto(Klasa obj)
dr_iton
5-Dec-13 5:07am
View
Thank you for your fast reply and you saved me.
Ok I got the point now and will resolve my problem, that was just a piece of code from my project. It works good, I only had problem on drawing because when I gave a higher value than amount, the balance did go to negative values which means I don't want to overdraw from my account and this solved my problem.
Once again thank you.
dr_iton
5-Jun-13 5:23am
View
After creating the three Class Libraries, there at the solution it tells me that I have 4 projects. The main one is named ScoMan in which one I have the web forms. The other ones I created as a class libraries are called BO (business objects), BLL (business logic layer) and DAL (Data access layer).
In BLL I created project classes like KlasaIURD (class Insert, Undo, Read, Delete), also I created a class in Bo named Klasa that holds the data of table from SQL server named KLASA,
in DAL created a class named KlasaDB where I'm planning to create stored procedures.
I need somehow to call Klasa from BO to the DAL and vice versa.
How to call them from different nsamespaces.
dr_iton
6-May-13 16:01pm
View
OK, couple weeks ago I started with ASP.NET, the problem was that I wasn't familiar with it and made the question. I solved the problem as sugested to me Espen Harlinn and the site looks much better now. I have another question, because I used a <marquee> HTML tag because i want to have a text like news hedlines in site that moves in up vertical direction, I recieve a message that Marquee tag is to old and is not supported in CSS3. What can I use instead of marquee in ASP.NET
Thank you in advance for you reply.
dr_iton
7-Feb-13 3:04am
View
Deleted
Yes, and sincerely, I have only 3 hours sleep and can not find a solution.
I populate a Server listbox with following:
public void ShtoStudentList()
{
try
{
ListaStudentet.Add(new KlasaStudentet(Convert.ToInt32(textBoxID.Text), textBoxEmri.Text, textBoxMbiemri.Text));
}
catch
{
MessageBox.Show("Gabim ne shenime", "Gabim!");
}
}
I make the connection with client with following:
private string ip = "127.0.0.1";
private int port = 9090;
private TcpListener listener = null;
public void ListenClients()
{
listener = new TcpListener(IPAddress.Parse(ip), port);
listener.Start();
while (true)
{
Socket clientSocket = listener.AcceptSocket();
Thread thread = new Thread(ClientWorker);
thread.Name = clientSocket.RemoteEndPoint.ToString();
thread.Start(clientSocket);
}
}
private void ClientWorker(object objectSocket)
{
Socket socket = (Socket)objectSocket;
NetworkStream ns = new NetworkStream(socket);
StreamReader sr = new StreamReader(ns);
StreamWriter sw = new StreamWriter(ns);
string welcome = "Welcome to my test server";
sw.WriteLine(welcome);
sw.Flush();
while (true)
{
try
{
data = sr.ReadLine();
}
catch (IOException)
{
break;
}
Console.WriteLine(data);
sw.WriteLine(data);
sw.Flush();
}
MessageBox.Show("I shkyqur nga serveri {0}", ip);
sw.Close();
sr.Close();
ns.Close();
}
What to do next?
dr_iton
7-Feb-13 2:49am
View
Yes, and sincerely, I have only 3 hours sleep and can not find a solution.
I populate a Server listbox with following:
public void ShtoStudentList()
{
try
{
ListaStudentet.Add(new KlasaStudentet(Convert.ToInt32(textBoxID.Text), textBoxEmri.Text, textBoxMbiemri.Text));
}
catch
{
MessageBox.Show("Gabim ne shenime", "Gabim!");
}
}
I make the connection with client with following:
private string ip = "127.0.0.1";
private int port = 9090;
private TcpListener listener = null;
public void ListenClients()
{
listener = new TcpListener(IPAddress.Parse(ip), port);
listener.Start();
while (true)
{
Socket clientSocket = listener.AcceptSocket();
Thread thread = new Thread(ClientWorker);
thread.Name = clientSocket.RemoteEndPoint.ToString();
thread.Start(clientSocket);
}
}
private void ClientWorker(object objectSocket)
{
Socket socket = (Socket)objectSocket;
NetworkStream ns = new NetworkStream(socket);
StreamReader sr = new StreamReader(ns);
StreamWriter sw = new StreamWriter(ns);
string welcome = "Welcome to my test server";
sw.WriteLine(welcome);
sw.Flush();
while (true)
{
try
{
data = sr.ReadLine();
}
catch (IOException)
{
break;
}
Console.WriteLine(data);
sw.WriteLine(data);
sw.Flush();
}
MessageBox.Show("I shkyqur nga serveri {0}", ip);
sw.Close();
sr.Close();
ns.Close();
}
What to do next?
dr_iton
6-Feb-13 17:10pm
View
One more question.
As you know, I saved the data in text files, afterwards I can populate a listbox in a Server form with those data from text files.
Is there a way that i can send those lisbox data to another form in a Client side or I have to read them from text files in Server side.
What is my solution, I know that i have to convert those data in byte and save somehow in a buffer, afterwards the client has to accept them and populate the listbox.
I don't know how to do this.
Cheers.
dr_iton
26-Jan-13 5:00am
View
I meaned how to open forms from different namespaces.
I created a program from twoo namespaces, in second namespace I have 4 forms which ones somehow using .Net and .Net.Sockets need to communicate with one form in first namespace.
P.S. The data of namespace2 forms are stored in three text files inside namespace1.
One more question: If I press debug, the form from namespace one is not Showing. How to fix it.
Thank you in advance for your reply.
dr_iton
25-Jan-13 12:37pm
View
That is what I'm trying to do.
Is there a way to make that hapen.
I'm still learning c# programming and I'm courious to know that if its possible or not.
Other question in this project is, I used text files to store the data, I have to store them in Server side of programm. Client side of programm it needs those data to fill the form using Sockets. I know how to get the data from Server to Clent in Console Application, but I don't know how to do that in Windows Form Application in net framework 3.5.
dr_iton
23-Jan-13 12:33pm
View
Deleted
Why not, it works to me.
dr_iton
23-Jan-13 5:22am
View
I solved the problem about checking if the string already exists in the listbox with following:
public void Xhirollog()
{
string xhiro;
Random rasti = new Random();
int numri = rasti.Next(10000000, 99999999);
xhiro = "1301" + numri;
bool ekziston = false;
foreach (string numer in ListBox.Items)
{
if (numer == xhiro)
{
ekziston = true;
break;
}
}
if (!ekziston)
xhirollogariaBox.Text = Convert.ToString(xhiro);
}
The reason that I convert the data to string is because i store them in a text file using StreamWriter and reading them using StreamReader.
Problem solved and thank you for your reply.
dr_iton
20-Jan-13 4:57am
View
Yes it is clear. Once again in my former Comment I asked a question and I'm realy stucked. If I make another input via xhirollogariaBox, how to check if the random nuber already exists in the listbox. xhirollogariaBox is filled with following method:
Random rasti = new Random();
int numri = rasti.Next(10000000, 99999999);
xhiro = "1301" + numri;
xhirollogariaBox.Text = Convert.ToString(xhiro);
Once again thank you for your reply and your clarifications, because as you see I'm a beginner in this forum.
Cheers.
dr_iton
19-Jan-13 16:51pm
View
Ok I slved the problem, but i Have another problem.
To add a client in the list I created the following Method:
ListaKlientet.Add(new KlasaKlientet(emriBox.Text, mbiemriBox.Text, dateTimePicker.Text,
vendlindjaBox.Text, xhirollogariaBox.Text, statusi));
The problem is that the xhirollogariaBox is a random number like this:
string xhiro;
Random rasti = new Random();
int numri = rasti.Next(10000000, 99999999);
xhiro = "1301" + numri;
xhirollogariaBox.Text = Convert.ToString(xhiro);
Is there a way that I can check if the random numer already exists in the LstBox.
dr_iton
4-Dec-12 5:01am
View
Is there a possibility to create a text file (without SQL database), in which I can register a new subscriber, and also if I want i can delete the subscriber from the list of text file.
Cheers.
dr_iton
3-Dec-12 17:37pm
View
My mother tongue is Albanian, I can create a class for a subscriber, but how to keep the evidence of taken and returned books. I know how to record a data into a program, but the problem is that I don't know how to delete the data for example if a subriber returns the book.
Show More