|
how could I scroll image for vb 2010?
|
|
|
|
|
|
increment a file path if already exists using mediafire,conversion options and mega data while saving a video in c#
|
|
|
|
|
That's a better subject-line than cross-posted version in the C# forum. Alas, this one is missing the code-dump and will look cryptic.
Please don't cross-post.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hello..i am a computer science student and this is my final year and i am developing a website for my semester project.in my developing website i am going to implement one live chat session same as like facebook chat using asp.net..i have searched for the code for a lot of times but i didn't get any valid code.so,can you please respond to my problem?i need one live chat session code for asp.net website..please help me... 
|
|
|
|
|
Member 12942419 wrote: have searched for the code for a lot of times but i didn't get any valid code. And that's the problem...
You are a student, which means you are learning and need to practice. If you search for code "ready to go solutions" you are never going to learn as you should.
Facebook has a lot of very good professional programmers. Don't you think, this might be a bit too much for your level?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
How is your project any reflection of your ability if you simply get the code elsewhere? If you get a job as a programmer and they want you to develop a hotel booking website what are you going to do? Search the net for hotel booking code? What if you can't find any or it doesn't meet client requirements?
No-one here is going to help you cheat your way to a qualification as we might end up working next to you one day.
|
|
|
|
|
Member 12942419 wrote: i have searched for the code for a lot of times but i didn't get any valid code I'm not sure what you are searching for but there are tons of examples online of how to do chatting using ASP.Net. You won't find anything you can copy and paste and be done with and I'm sure you wouldn't want that anyway.
So, get started writing the code. If you ever want a job programming you'll never be able to copy and paste entire projects of code off the internet. So, learn. Do.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi All,
I use Visual Studio 2010 to develop a Web Form Application and use the DevExpress Controls in this application, my problem is when I open the design view of a page called index2.aspx which contains many controls it takes a long time ti view the design and the html code repeated and duplicated.
Example: if I have a break line tag
<br/> in index2.aspx it is duplicated to many lines like this
<br/>
<br/>
<br/>
Please let me know how to solve this issue.
Thank You All
|
|
|
|
|
I didnt find any AngularJS example which works with Asp.net web app. Please provide a link / Example
|
|
|
|
|
|
Sorry Richard, please make it is clear.
|
|
|
|
|
|
Are you talking about WebForms (because there is also ASP.NET MVC)?
Don't use Angular with WebForms; that's just dumb. They do the exact same thing, except one renders on the client and the other renders on the server.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Yes Nathan, I am talking about plane asp.net web forms not Asp.net MVC.
|
|
|
|
|
Then the rest of my post applies.
Don't do it. It's a bad idea. Switch to MVC/WebAPI/Nancy/Whatever or stick with WebForms(if you must), but do not entangle your data-binding and presentation between WebForms and Angular. That's a recipe for high technical debt, mind-numbing complexity, and long-term disaster.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Greetings all
I am sure I am doing something wrong here.
We have a dropdownlist that has three values, Today, Yesterday and ALL.
There is always a record for today and All.
However, there are times when yesterday falls on Weekends and in some cases, there are no record created for that particular weekend.
In situations such as that, we would like a message to user that there are no records from yesterday.
Does anyone have any ideas why this code is not displaying that message?
Private Sub Bindgrid()
Dim s As String = ""
Dim reportType = ddlrpttype.SelectedValue
conn.Open()
If reportType = "Today" Then
s = "SELECT * from mytble WHERE (DATEDIFF(day,CONVERT(datetime,work_request.date, 121),GETDATE()) = 0 ) "
ElseIf reportType = "Yesterday" Then
s = "SELECT * FROM mytble WHERE (DateDiff(Day, Convert(DateTime, work_request.date, 121), GETDATE()) = 1 )"
ElseIf reportType = "All" Then
s = "select * from mytble"
Else
lblmsg.Text = "No record found from yesterday.")
End If
'Response.Write(s)
'Response.End()
Dim cmd As New SqlCommand(s, conn)
Dim dr As SqlDataReader = cmd.ExecuteReader()
reportgrv.DataSource = dr
reportgrv.DataBind()
conn.Close()
End Sub
|
|
|
|
|
samflex wrote: Does anyone have any ideas why this code is not displaying that message? Yes, and it's very simple. So, that makes me think you do not know how to code which means fixing this code to do what you want it to do is not necessarily a simple task.
Look at this code:
If reportType = "Today" Then
s = "SELECT * ..."
ElseIf reportType = "Yesterday" Then
s = "SELECT * ..."
ElseIf reportType = "All" Then
s = "select * from mytble"
Else
lblmsg.Text = "No record found from yesterday.")
End If
and just read it out in English. If reportType is equal to the word "Today" then do ..., else if reportType is equal to the word "Yesterday", etc.
What you want is to display a message if there are no records, not if the report type is not one of the values you are checking.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
The only time you're displaying the message is if the reportType is not set to either "Today" , "Yesterday" or "All" . If it's one of those values, but there are no matching records, you don't display the message.
As an aside, it looks like you're storing the date in a varchar column. That's an extremely bad idea. You should use one of the date/time types[^] provided by SQL.
Using con As New SqlConnection("...")
Using cmd As New SqlCommand("", con)
Dim reportType As String = ddlrpttype.SelectedValue
If reportType = "Today" Then
cmd.CommandText = "SELECT * FROM mytble WHERE work_request_date >= @MinDate And work_request_date < @MaxDate"
cmd.Parameters.AddWithValue("@MinDate", DateTime.Today)
cmd.Parameters.AddWithValue("@MaxDate", DateTime.Today.AddDays(1))
ElseIf reportType = "Yesterday" Then
cmd.CommandText = "SELECT * FROM mytble WHERE work_request_date >= @MinDate And work_request_date < @MaxDate"
cmd.Parameters.AddWithValue("@MinDate", DateTime.Today.AddDays(-1))
cmd.Parameters.AddWithValue("@MaxDate", DateTime.Today)
Else
cmd.CommandText = "SELECT * FROM mytble"
End If
Using dr As SqlDataReader = cmd.ExecuteReader()
reportgrv.DataSource = dr
reportgrv.DataBind()
End Using
End Using
End Using
If reportgrv.Rows.Count = 0 Then
lblmsg.Text = "No matching records found."
Else
lblmsg.Text = Nothing
End If
As an alternative to manually updating the label, you could use either the EmptyDataTemplate[^] or EmptyDataText[^] properties on the GridView to display a message when there are no rows to display.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
 Hi Richard,
As usual, thanks so much for your constructive help.
I was able to get it to for me, slightly different from my original idea but we are fine with the results from the code below:
Private Sub BindGrid()
Dim s As String = ""
Dim reportType = ddlrpttype.SelectedValue
conn.Open()
If reportType = "Today" Then
s = "SELECT * from mytable WHERE (DATEDIFF(day,CONVERT(datetime,mytable.date, 121),GETDATE()) = 0) ORDER By date DESC "
ElseIf reportType = "Yesterday" Then
s = "SELECT * FROM mytable WHERE (DateDiff(Day, Convert(DateTime, mytable.date, 121), GETDATE()) = 1) ORDER By date DESC "
ElseIf reportType = "All" Then
s = "select * from mytable ORDER By mytable_no DESC "
Else
s = "select * from mytable ORDER By mytable_no DESC "
End If
Dim cmd As New SqlCommand(s)
reportgrv.DataSource = GetData(cmd)
reportgrv.DataBind()
'Showing Numbers in Label
Dim iTotalRecords As Integer = DirectCast(reportgrv.DataSource, DataTable).Rows.Count
Dim iEndRecord As Integer = reportgrv.PageSize * (reportgrv.PageIndex + 1)
Dim iStartsRecods As Integer = iEndRecord - reportgrv.PageSize
If iEndRecord > iTotalRecords Then
iEndRecord = iTotalRecords
End If
If iStartsRecods = 0 Then
iStartsRecods = 1
End If
If iEndRecord = 0 Then
iEndRecord = iTotalRecords
End If
lblTotalRecords.Text = "Total records Found: " & iTotalRecords.ToString() & ""
End Sub
And yes, you are absolutely correct, the date data type is of varchar. I don't design databases like this. I inherited this.
On a separate note, please forgive me for saying this.
This guy that calls himself RyanDev, I just would hope he can learn to avoid my threads.
I have followed some of his post and a lot of them laden with insults.
My parents thought us that if you don't have anything good to say, don't say anything at all.
He must have been raised from a family environment where insults reign. He certainly is a good student because he copied very well.
|
|
|
|
|
samflex wrote: and a lot of them laden with insults. Where did I insult you?
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi,
I have a second problem, which is very hard to describe for me.
The project i have to work on was a .net2.0 project. I added MVC and so I had to re-build the whole project with .net4.
I don't know if *that* is the reason for this strange behaviour, but:
On my local development computer everything works fine.
On the productive server (same code), I get
Quote: ErrorMessage: The object of type "System.Web.UI.WebControls.Label" can not be converted to type "System.Web.UI.WebControls.TextBox".
when a datagrid binds its data from a stored procedure.
It does not make sense to me, but I can't describe the problem better.
If anyone of you have an idea, where I could better or more information, which could lead to a solution.
All the best,
Markus
|
|
|
|
|
You need to track down the line of code failing and look at the stack trace. If it works in dev that tells me you have some data coming back from the db that is different on the prod server that is causing the problem.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi RyanDev,
also thanks for replying to this topic.
I'm working on my local development machine, but I'm connected with the productive database.
Yes, - I'm also thinking, that it looks like, as if the problem is caused by an not compatible result of the stored procedure.
But as it is the some database, with the same stored procedure ... I'm asking myself if the different version could be the problem.
All the best,
Markus
|
|
|
|
|
Somewhere you are casting a Label to a TextBox;
TextBox t = (TextBox)e.Item.FindControl("XYZ");
so in the above if the control "XYZ" is a Label you'll get this error, look for this kind of code in the bind events of the gridview.
|
|
|
|