15,920,217 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 sesenyg (Top 33 by date)
sesenyg
21-Dec-12 4:01am
View
Yes you are absolutely right. The only problem is 'INSERT INTO'. Thank you so much.
sesenyg
21-Oct-12 13:17pm
View
Thanks for your attention:)
sesenyg
21-Oct-12 13:15pm
View
OK, now i did it truely. I add one more if clause like
<input type="text" size="8"
value="
sesenyg
21-Oct-12 13:10pm
View
or in other words, it gets even in default.
sesenyg
21-Oct-12 13:07pm
View
It still behaves the same, it gets 0 default.
sesenyg
2-Aug-12 2:53am
View
yeap i did:)
sesenyg
1-Aug-12 6:17am
View
Thanks for your helps:)
sesenyg
1-Aug-12 6:17am
View
thanks for your attention.
sesenyg
1-Aug-12 4:58am
View
i tried your datatable, dataadapter method. I realize dt is empty this time. I really don't understand, how my first sql command works fine but second returns null value??
And when i tried to dr.HasRows() method. It did not work again:(
sesenyg
1-Aug-12 4:53am
View
I have two sql command one of them work fine and i used my request.querystring value on my first sqlcommand. It returns the true value.
sesenyg
1-Aug-12 4:49am
View
I already try this. No rows returns. dr is empty
sesenyg
1-Aug-12 4:48am
View
No, it did not:'(
sesenyg
1-Aug-12 4:33am
View
Data is coming but i think the problem is datareader. It realize that it is empty.
sesenyg
1-Aug-12 4:26am
View
No, it did not work again:(
sesenyg
1-Aug-12 4:25am
View
I try to get data from database to write textboxes on website. TC is primary key, so it can not leave null. The code can not enter while loop , because i put a breakpoint in while loop but it did not stop anywhere.
sesenyg
1-Aug-12 4:18am
View
And i can get data to my gridview 'MeasureRecord' so the problem is really not connection problem..
sesenyg
1-Aug-12 4:14am
View
This is my whole code, i said the problem is not connection problem:(
SqlConnection conn = new SqlConnection();
SqlDataReader dr;
conn.ConnectionString = "server= ***; user = ***; pwd= ***; database = ***";
conn.Open();
string TCNumber = Request.QueryString["TC"].ToString();
SqlCommand comm = new SqlCommand("SELECT Sistolic,Diastolic,Pulse,Date from
MeasureRecords WHERE TC='"+TCNumber+"'");
SqlDataAdapter adap = new SqlDataAdapter(comm);
comm.Connection=conn;
DataSet ds = new DataSet();
adap.Fill(ds);
MeasureRecord.DataSource = ds;
MeasureRecord.DataBind();
SqlCommand comm2 = new SqlCommand("SELECT TC, Name, Surname, BirthDate, Phone from Pers_Info WHERE TC='"+TCNumber+"'");
comm2.Connection = conn;
dr = comm2.ExecuteReader();
while (dr.Read())
{
TCNo.Text = dr["TC"].ToString();
Name.Text = dr["Name"].ToString();
Surname.Text = dr["Surname"].ToString();
BirthDate.Text = dr[3].ToString();
Phone_Number.Text = dr[4].ToString();
}
dr.Close();
dr.Dispose();
conn.Close();
sesenyg
1-Aug-12 4:02am
View
No, unfortunatelly it is not, i did not add my connection lines there. The problem is not connection problem:(
sesenyg
31-Jul-12 8:06am
View
Thank you so much dude:)
sesenyg
31-Jul-12 7:52am
View
No, it is impossible. I have to leave it string. Is there anyway to compare a string in select-where query?
sesenyg
31-Jul-12 7:50am
View
Actually, my parameter TC is string which i used in sql command. Firstly, i try to do
string TCNumber = Request.QueryString["TC"].ToString();
SqlCommand comm = new SqlCommand("SELECT Sistolic,Diastolic,Pulse,Date from MeasureRecords WHERE TC= @TCNumber;", conn);
but it gave me errors, so i change the data type. I think the first problem is my data TC on database is a string but i try to match it with an int.
sesenyg
31-Jul-12 7:49am
View
Deleted
Actually, my parameter TC is string which i used in sql command. Firstly, i try to do
string TCNumber = Request.QueryString["TC"].ToString();
SqlCommand comm = new SqlCommand("SELECT Sistolic,Diastolic,Pulse,Date from MeasureRecords WHERE TC= @TCNumber;", conn);
but it gave me errors, so i change the data type. I think the first problem is my data TC pn database is a string but i try to match it with a int.
sesenyg
31-Jul-12 7:41am
View
No, it did not work. It said the same thing again:(
sesenyg
31-Jul-12 7:38am
View
Thank you for your solution it helped me but now it says "the conversion of the varchar value '4577765884' overflowed an int column." Do you know what is this?
sesenyg
31-Jul-12 4:15am
View
I find the problem, thanks:)
sesenyg
27-Jul-12 8:03am
View
thanks a lot:)
sesenyg
27-Jul-12 8:03am
View
QueryString method solved my problem. Thanks:))
sesenyg
27-Jul-12 6:27am
View
Thanks dude:)
sesenyg
26-Jul-12 8:21am
View
thanks:)
sesenyg
26-Jul-12 8:21am
View
Thank you, it solved problem perfectly:)
sesenyg
26-Jul-12 7:56am
View
hi,
I write this code like your advise but the code could not find the address.
Can you explain more detailed?
this is my code
string X = dr[0].ToString();
Response.Redirect("ETC.aspx?Data=X ");
sesenyg
26-Jul-12 3:21am
View
First of all thanks of your interest but i have already put + signs to my code. Moreover, barneyman answer my question. Thanks:)
sesenyg
26-Jul-12 3:19am
View
actually you are so right, now i understood the problem. It made me crazy for 2 days. Thank you so muchhh!!!!
Show More