|
Hi, do you know of a simple VB.NET code for username and password validation that does not involve the use of stored procedure or appsetting? I've found several that use stored procedures and other complicated stuff that I don't yet understand. I'm new to web development and I'm trying to go from the really simple stuff to the more advance stuff one step at a time. It would be great if you could point me to an online tutorial. Thanks in advance for your help.
-- modified at 1:13 Saturday 16th June, 2007
|
|
|
|
|
|
Yes, that's a good way of learning ASP.NET...
---
single minded; short sighted; long gone;
|
|
|
|
|
There are a lot of examples out there that are not as complicated.
Google "VB.NET sql query"[^]
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I am a new user of Chart Fx Componet. I am using chart FX 6.2 version with visual studio 2005 in asp.net 2.0(Vb.net).
I have two arrays
for examlpe
dates = { 1/1/2007, 2/1/2007,3/1/2007 }
percentage = { -10.2%, 20.5%,30.4%}
I was able to plot this data using the following code
Dim chartValues(1) As ArrayList
chartValues(0) = percentage
chartValues(1) =dates
Dim lstProvider As New SoftwareFX.ChartFX.Data.ListProvider(chartValues)
Chart1.DataSourceSettings.DataSource = lstProvider
I am not able to set the xaxis and yaxis labels
as of now I am getting Irrelavant labels.
Question1 -How to set the label for xaxis as Jan 2007, feb 2007, march 2007 etc.. According to the data in the dates array.
Question2 -How to set the label for yaxis According to the data in the percentage array.
the number of data in the array may vary from time to time.
I would appreciate if you could send me a example or code snippet on this
Thanks in Advance
|
|
|
|
|
Hi All,
I want to view a pdf document, and some controls on the same page, in asp.net 2.0, like in one div my controls, and other div pdf document.
I am not intended to use IFRAME.If there is other solution please suggest.
Many Thanks,
adnan
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
You just hyperlink to the PDF document. The web browser would take care of displaying it with the help of Acro Helper plugin.
|
|
|
|
|
Thanks for reply. But i dont want to show pdf in single page.
I am inteneded to show PDF with other controls, and it should run in all browsers, that's y i not intended to use IFRAME, and and due to IFRAME, i can assign file to Iframe, in partial file.
If the things are not stated clearly in my questions please ask, i will try to explain what i want, and again thanks for help
Many Thanks,
adan
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
my webdirectory currently looks like this
<br />
/www/web.config<br />
<br />
I am trying to add a new application just for testing at this time in a subfolder and it has its' own web.config document.<br />
<br />
/www/TestApp/web.config<br />
The Error i am getting
<br />
Server Error in '/' Application.<br />
Configuration Error<br />
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.<br />
<br />
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.<br />
The Source Error is pointing to my Web.Config authentication mode ="Forms". I do not have physical control of the web server.
I hope this is enough information for someone to set me in the right direction, thanks!
|
|
|
|
|
Does anybody have experiences with Fragment cache? I have some trouble here...
Basically, I have 3 dropdownlists, ddlAccountGroupType, ddlGroupName and ddlAccountID in a user control. The reason I use cache varybycontrol because ddlAccountID could contain over 8000 accounts. Once the selected index is changed in ddlAccountID, it will raise event handler to trigger the parent page to retrieve Order list and allow user to edit the order details. So, I have <%@OutputCache duration="600" varybycontrol="ddlAccountGroupType;ddlGroupName;ddlAccountID" %> on my .ascx file.
The problem is , sometimes, when parent page do a postback, the second dropdownlist ddlGroupname become empty when it was supposed to have one single item "--ALL--". I couldn't figure out why it happens. I read about some discussion said, under memory pressure, the cached data could be removed before it reaches its expire date. Did anyone have similiar issue? I know you can set programmatic cache NotRemovable. Is there a way to set fragement cache NotRemovable?
By the way, I read something about Cache does not work with Web Farms. Although my problem happens on my local development server, but my production server does use web farm. Do anyone have any thoughts or suggestions about this?
Any help would be very appreciated!
Thanks in advance!
|
|
|
|
|
any suggestion would be appreciated!
|
|
|
|
|
Hi,
I have a solution which consists of three projects: a web app, a command line app and a dll containing some code to access a web service. The DLL is confusing me because there seems to be two references to my web service:
1. There's an actual "Web Reference" with "URL Behavior" set to "Dynamic". This seems to get used by the web app when it accesses the DLL.
2. There's also an app.config file which contains a "Properties.Settings" value for the web service's URL and this seems to relate to a "Settings.settings" file in the app's project under the "Properties" folder. This setting seems to get used by the command line app when it accesses the DLL.
If I want to change the web service's URL, I'd like to be able to just change the app.config if possible. Is that possible? Do I need the web reference as well? I think I do because otherwise I don't have a namespace I can use.
How do I have just one reference to the web service in my DLL?
Thanks
|
|
|
|
|
You can't make it totally central to one location. You have to have the Web Reference mostly for the IDE. You can make all references to it in your code look at one place that way you change it there, and the Web Reference.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
It looks like then, that I have to rebuild my apps if I want to move the web service they refer to
|
|
|
|
|
Hi all,
An error occurs when i use SqlConnection object to connect to Sql Server
Here is the stack trace:
at LoadLibraryW(UInt16* )
at System.EnterpriseServices.Thunk.Security.Init()
at System.EnterpriseServices.Thunk.Security.SuspendImpersonation()
at System.EnterpriseServices.Platform.Initialize()
at System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb) at System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl)\n at System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl ctrl, IntPtr SID)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
I actual can't understand and don't know how to resolve the problem
Thanks
|
|
|
|
|
Have a look at this link[^]
From MSDN
The problem was generated by Kaspersky Antivirus 6.0.2.621; even if it was disabled or closed, the exception still occured.
Now I'm using Kaspersky Antivirus 6.0.1.411 and all works fine.
Weird, and someone actually found a solution to it.
|
|
|
|
|
Hi all,
I'm having problems trying to move a file from my IIS server to a unc share on the same domain. I know it all boils down to a permission issue (the bane of my existence). I'm running IIS 5.0 (in production) and 5.1 (in test). I have impersonate set to true in web.config. Most everything else is pretty much default including the ASPNET account running the worker process. I know I have read/write permission in the share. I've even gone as far as to slip an WindowsImpersonationContext around the move code only to get the same Access denied error. I found this article[^] about Kerberos delegation which sounds like it could work but I wouldn't be able to give delegation rights to. Do I need to run the worker process under a domain account instead of the local ASPNET account? Has anybody else have this kind of issue?
Keith
|
|
|
|
|
Ok, so the moral of this story, use a domain account to run your asp.net process when you need to access network resources on the same domain. Well, that's the moral I used anyway. If anybody has other solutions to this, I'd like to hear them too. Here's an article for asp.net 1.1 which I took bits and pieces of to get the solution working http://msdn2.microsoft.com/en-us/library/aa302396.aspx[^]
Keith
|
|
|
|
|
hai dears,
i got an error while running from web deployment project,
that "cannot create activeX component" for excel.application..
But the same works perfectly while running from the code..
do have any solution ?
dhanis
|
|
|
|
|
Hi,
I have a web reference in my code that allows me to access a web service. I want to make sure that I'm accessing the right web service by checking the URL that's stored under the web reference.
For example if I'm accessing the web service from server X rather than server Y, I can just refer to the URL but can I get hold of this value somehow?
Thanks
|
|
|
|
|
|
|
Hi,
I'm trying to construct a datagrid dynamicly by reading properties from an Xml File.
so i've defined a template column so they fit the type of controls defined in the xml.
this is code wish define the template column
public class GenericItem : ITemplate
{
private readonly string column;
//private bool validate;
public GenericItem(string column)
{
this.column = column;
}
public void InstantiateIn(Control container)
{
Literal l = new Literal();
l.DataBinding += new EventHandler(this.BindData);
container.Controls.Add(l);
}
public void BindData(object sender, EventArgs e)
{
Literal l = (Literal)sender;
DataGridItem container = (DataGridItem)l.NamingContainer;
l.Text = ((DataRowView)container.DataItem)[column].ToString();
}
}
public class ValidateEditItem : ITemplate
{
private readonly string column;
public ValidateEditItem(string column)
{
this.column = column;
}
public void InstantiateIn(Control container)
{
TextBox tb = new TextBox();
tb.DataBinding += new EventHandler(this.BindData);
container.Controls.Add(tb);
tb.ID = column;
RequiredFieldValidator rfv = new RequiredFieldValidator();
rfv.Text = "please write!";
rfv.ControlToValidate = tb.ID;
rfv.Display = ValidatorDisplay.Dynamic;
rfv.ID = "validate" + tb.ID;
container.Controls.Add(rfv);
}
public void BindData(object sender, EventArgs e)
{
TextBox tb = (TextBox)sender;
DataGridItem container = (DataGridItem)tb.NamingContainer;
tb.Text = ((DataRowView)container.DataItem)[column].ToString();
}
}
public TemplateColumn DynamicColumns(string column, bool isEditable)
{
TemplateColumn genericcolumn = new TemplateColumn();
genericcolumn.HeaderText = column;
genericcolumn.ItemTemplate = new GenericItem(column);
if (isEditable)
{
genericcolumn.EditItemTemplate = new ValidateEditItem(column);
}
return genericcolumn;
}
and the way i contruct column is
if (Type != null)
{
//case of primary key
BoundColumn ColPk = new BoundColumn();
ColPk.DataField = c.ColumnName;
ColPk.SortExpression = c.ColumnName;
ColPk.ReadOnly = true;
Grid.Columns.Add(ColPk);
}else
{
//case of other column
TemplateColumn col;
col = DynamicColumns(c.ColumnName, true);
col.SortExpression = c.ColumnName;
Grid.Columns.Add(col);
}
so that I'm sure to make the primary Key not editable;
but the problem is how to retreive the primary key from datagrid
while it's in readOnly and I've want the value of this key to make Update
I've tried with two method
public void GridUpdate(Object sender, DataGridCommandEventArgs e)
{
//the first way
e.Item.FindControl("key").Text ;->it returns null ;
//the second way
grid.DataKeys[e.Item.ItemIndex];->the grid.Datakeys isempty
}
So I can't contruct the UpdateQuery
thank in advance for help
|
|
|
|
|
I do initialize some controls on Page_Load.
Sub Page_Load(ByVal Sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
SQLconn.Open()
Dim SelectCmd1 As New SqlCommand("SP1", SQLconn)
SelectCmd1.CommandType = CommandType.StoredProcedure
Dim result1 As Integer
Dim myDataReader1 As SqlDataReader
myDataReader1 = SelectCmd1.ExecuteReader()
myDataReader1.Read()
result1 = myDataReader1.GetInt32(0)
SQLconn.Close()
ChangeButton(result1)
End Sub
Sub ChangeButton(ByVal Status As Integer)
If Status = -1 Then
Label1.Text = "ON"
OnOff1.Style.Value = "background-image: url(../ImgContr/1.png);"
Else
Label1.Text = "OFF"
OnOff1.Style.Value = "background-image: url(../ImgContr/2.png);"
End If
End Sub
I moved the code from Page_Load to MyRefresh bc I want to call this code fom other events too:
Sub Page_Load()
If Not Page.IsPostBack Then
MyRefresh()
End If
End Sub
Sub MyRefresh()
SQLconn.Open()
Dim SelectCmd1 As New SqlCommand("SP1", SQLconn)
SelectCmd1.CommandType = CommandType.StoredProcedure
Dim result1 As Integer
Dim myDataReader1 As SqlDataReader
myDataReader1 = SelectCmd1.ExecuteReader()
myDataReader1.Read()
result1 = myDataReader1.GetInt32(0)
SQLconn.Close()
ChangeButton(result1)
End Sub
I don't get any errors but the controls get no values from the database. Something is missing but I don't know what.
Thanks
-- modified at 10:05 Friday 15th June, 2007
|
|
|
|
|
Have you tried debuging the code? What is the value that you are passing into the changebutton method? when you call the stored procedure manually do you get what you are expecting?
I would guess that your call to the stored procedure is not returning what you are expecting. Try debugging the code and see if that helps you figure it out.
Ben
|
|
|
|