|
Im trying to display information from a datbase using datagrid on the website but I keep getting the following error:
'ASP.customers_aspx does not contain a definition for 'SqlDataSource1_Selecting'
anyone know why???/
|
|
|
|
|
I would go back and review the code, the key part is 'does not contain a definition for sqlDataSource1_Selecting.
tim637
|
|
|
|
|
Hi friends,
Can anyone advice me how to post some html fields to a specific url (https) using .net and c#.
Thanks and Rgds
Nithin
|
|
|
|
|
You could firstly just sent the action of the form to the destination, which would be the easiest way. However, a while back I wrote a simple class which would allow you to post to a Url from code which is included below in case you find it useful
<br />
Public Class Poster<br />
<br />
#Region " Properties "<br />
<br />
Private values As New System.Collections.Specialized.NameValueCollection<br />
<br />
Private _postUrl As String<br />
Public Property PostUrl() As String<br />
Get<br />
Return _postUrl<br />
End Get<br />
Set(ByVal value As String)<br />
_postUrl = value<br />
End Set<br />
End Property<br />
<br />
Private _formName As String = "form1"<br />
Public Property FormName() As String<br />
Get<br />
Return _formName<br />
End Get<br />
Set(ByVal value As String)<br />
_formName = value<br />
End Set<br />
End Property<br />
<br />
Private _method As String = "POST"<br />
Public Property Method() As String<br />
Get<br />
Return _method<br />
End Get<br />
Set(ByVal value As String)<br />
_method = value<br />
End Set<br />
End Property<br />
<br />
Public Sub AddValue(ByVal name As String, ByVal value As String)<br />
values.Add(name, value)<br />
End Sub<br />
<br />
<br />
#End Region<br />
<br />
#Region " Publish Methods "<br />
Public Sub Post()<br />
If PostUrl Is Nothing Then Throw New Exception("No Url specified")<br />
If FormName Is Nothing Then Throw New Exception("No Form Name specified")<br />
If String.IsNullOrEmpty(Method) Then Throw New Exception("No method specified")<br />
'if values.Count=0 then throw new Exception("No post values supplied")<br />
<br />
HttpContext.Current.Response.Clear()<br />
HttpContext.Current.Response.Write("<HTML><HEAD>")<br />
HttpContext.Current.Response.Write(String.Format("</HEAD><BODY onload=""document.{0}.submit()"">", FormName))<br />
HttpContext.Current.Response.Write(String.Format("<form name=""{0}"" method=""{1}"" action=""{2}"" >", FormName, Method, PostUrl))<br />
For i As Integer = 0 To values.Count - 1<br />
System.Web.HttpContext.Current.Response.Write(String.Format("<input name=""{0}"" type=""hidden"" value=""{1}"">", values.Keys(i), values(values.Keys(i))))<br />
Next<br />
<br />
HttpContext.Current.Response.Write("</form>")<br />
HttpContext.Current.Response.Write("</body></html>")<br />
HttpContext.Current.Response.End()<br />
End Sub<br />
#End Region<br />
<br />
End Class<br />
|
|
|
|
|
pmic:
how i can understand that , which website(url) was opened in computer?
or
which website(url) is opene in computer now
thanks.
maysam_mici @yahoo.com
|
|
|
|
|
How did this differ from the other query you posted at this permalink [^] just about three minutes back?
|
|
|
|
|
It doesn't. It's a duplicate.
|
|
|
|
|
Please don't duplicate posts. If the second post was accidental, please remove it (but only if there are no responses) otherwise remove the first post (again, only if there are no responses). If it wasn't accidental, you need to realize that the people here answer questions on a volunteer basis and will probably not respond in a timeframe you desire or find acceptable.
|
|
|
|
|
hello sir,
i am new in .net. i had made a window application in c#.net
as front end and sql-sever as back end.
now the problem is that how to install sql-server ,.netframework,and execute sql-script and my project on client computer step by step. plz give me details .
your shuaib
|
|
|
|
|
I doubt you're going to get a step by step runthrough. This is quite a length topic, and there are several good articles on this. Try searching on google for details on .net setup with sql server.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I write a C++ program which does the installation of the framework, etc, then I'd build into my app or write a seperate app that runs the scrpts to create the DB.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have created an add-in to Visual Studio 2005, and I would like to use a WCF service.
This requires a configurationfile with the configured endpoints. Normally I would create an app.config, and let visual studio build it to [appname].config in the output directory and it would work.
But when I try to access the services from the add-in, i get a configuration error that the endpoints are not configured. How do i make it open the configuration for the add-in, and not for Visual Studio?
With kind regards
Soren Bendtsen
|
|
|
|
|
If I'm in the wrong place or this is a stupid question I apologise in advance.
I am having to write a data acquisition program in .NET (C#) before I’ve had time to learn it which is making for some interesting code. What I would really like to do is reference a group of 24 progress bar components within a for/next loop using the index of the loop. Does anyone know how to do this? The code I use at the moment is very inelegant and bugs me. Would appreciate any pointers (sorry ‘bout pun)
Ted Edwards
|
|
|
|
|
Wow Ted, that just sounds horrible. But given your situation:
sysrev wrote: before I’ve had time to learn it
and
sysrev wrote: a group of 24 progress bar components
With that situation I would go with "if it works, I don't care".
|
|
|
|
|
But I'll need to do it again somewhere - and again, and again.........
Ted Edwards
|
|
|
|
|
Hi,
hard to give a good answer without knowing your exact situation. You could add all progress bars to a List<progressbar>. After you have done this once you can iterate the list with for/foreach or whatever technique you like.
Robert
|
|
|
|
|
Thanks for the suggestion Robert.
The progress bars display the output of a pressure sensor over a 24 hour period. When I get a new reading, I shift values chronologically "down" one bar and put the new value in the "top" (most recent) bar. The coding begs for an iterative loop but I don't know how to address the bars name property with the index. So I ended up using a switch construct which works okay but is awkward to maintain.
The List class is new to me and on your suggestion I had a quick look at it. I must say, it does not look promising but will try it out if I can.
Ted
|
|
|
|
|
Hi,
I'll try to outline what I meant:
private List<ProgressBar> _bars;
_bars = new List<ProgressBar>(new ProgressBar[] { pb1, pb2, pb3, ... });
for (int i = 0; i < 24; i++)
{
_bars[i] = someArrayWithTheValues[i];
}
With the mod operator you could also easily switch which hour should be displayed at the top:
int hourToDisplayAtTop = 4;
for (int i = 0; i < 24; i++)
{
_bars[i] = someArrayWithTheValues[(i + hourToDisplayAtTop) % 24];
}
Robert
|
|
|
|
|
I think I can see what you are suggesting and am trying to experiment with it in a new application as here:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace IndexComponents
{
public partial class Form1 : Form
{
private ProgressBar pb1;
private ProgressBar pb2;
private ProgressBar pb3;
private List<ProgressBar> _bars;
public Form1()
{
InitializeComponent();
int[] someArrayWithTheValues = new int[3] { 1, 2, 3 };
//Field declaration in the Form/UserCotrol
/// private List _bars;
//somewhere after the InitializeComponents call
/// _bars = new List(new ProgressBar[] { pb1, pb2, pb3 });//when you want to update the bars
_bars = new List<ProgressBar>(new ProgressBar[] { pb1, pb2, pb3 });//when you want to update the bars
for (int i = 0; i < 3; i++)
{
_bars[i] = someArrayWithTheValues[i];
}
//With the mod operator you could also easily switch which hour should be displayed at the top:
int hourToDisplayAtTop = 2;
for (int i = 0; i < 3; i++)
{
_bars[i] = someArrayWithTheValues[(i + hourToDisplayAtTop) % 24];
}
}
}
}
I am now working on the last two(I hope!) build error which are flagged within the two for loops as below:
Error 1 Cannot convert type 'int' to 'System.Windows.Forms.ProgressBar'
Error 2 Cannot implicitly convert type 'int' to 'System.Windows.Forms.ProgressBar'
Ted Edwards
|
|
|
|
|
Replace _bars[i] = ... with _bars[i].Value = ...
(Sorry, my mistake)
Robert
|
|
|
|
|
That's great. It all works - I can experiment further now I have a working example.
Thanks for your help.
Ted
|
|
|
|
|
PC Administrator, using my application, needs to select a folder in which any standard user could read and write. My application needs to verify for any selected folder whether a standard user can read-write into it. How do i do that?
Note that the folder is being set up by Administrator, so checking current read-write access is no good.
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
|
You could impersonate a standard user and then attempt to read from/write to that folder, if they both work then you have the correct permissions.
|
|
|
|
|
I want to auto login a website(for example,gmail) from winform client.The realization is as follow.
SHDocVw.InternetExplorer IE = new InternetExplorer();
IE.Visible = true;
string URL = "http://www.gmail.com";
object nullArg = null;
IE.Navigate(URL, ref nullArg, ref nullArg, ref nullArg, ref nullArg);
Thread.Sleep(5000);
mshtml.IHTMLDocument2 DOM = (mshtml.IHTMLDocument2)IE.Document;
mshtml.IHTMLInputTextElement textBoxUserName = (mshtml.IHTMLInputTextElement)DOM.all.item("Email", null);
textBoxUserName.value = "****";
mshtml.IHTMLInputTextElement textBoxPassword = (mshtml.IHTMLInputTextElement)DOM.all.item("Passwd", null);
textBoxPassword.value = "****";
Thread.Sleep(3000);
mshtml.HTMLInputElement img = (mshtml.HTMLInputElement)DOM.all.item("signIn", 0);
img.click();
Thread.Sleep(5000);
I code it in vs .net 2005.It works on my machine.But it fails on the machine that only installs .NET 2.0 Framework.The error information is as follow:
System.InvalidCastException Message: Unable to cast COM object of type 'System.__ComObject' to
class type 'mshtml.HTMLDocumentClass'. COM components that enter the
CLR and do not support IProvideClassInfo or that do not have any
interop assembly registered will be wrapped in the __ComObject type.
Instances of this type cannot be cast to any other class; however they
can be cast to interfaces as long as the underlying COM component
supports QueryInterface calls for the IID of the interface.
How can I solve this problem?
|
|
|
|