vuyiswamb 17 Posting Whiz

This is the Best Answer i have ever got from Daniweb. Am a C#,ASP.NEt Programmer and do a lot of SQL but never went this deep, and most of the time am the one helping others and i needed help and this is the Best answer i have ever got from this Forum.

Thank you and its working like charm :)

Kind Regards

Vuyiswa Maseko

vuyiswamb 17 Posting Whiz

Good Afternoon All , i have a page that does some updates, and i have my own progress bar and there is a strange Ajax(i think so) progress bar that is showing and its making my page to be slow.

[IMG]http://www.vbforums.com/attachment.php?attachmentid=71442&stc=1&d=1244725295[/IMG]

As you can see there is a Small black Progress thing there.

What is it and how do i remove it.


Thanks

vuyiswamb 17 Posting Whiz

Good Day all

i have a Ultrawebgrid i n my page and i display Data in this Way

STAFF                CYCLES
=========================
Galloway A Ms	  20,22,23,24,25,26
Gama, E	          20,22,24,25
Grieve S Ms	  20,25,26
Jones D Dr	  24,26

and a user can select the Staff in the Grid by Holding a Control key and i have trapped the selection in the Gridstaff_SelectedCellsChange and handled it like this

protected void Gridstaff_SelectedCellsChange(object sender, SelectedCellsEventArgs e)
    {
        Change_Control_Availability_Cycles_Enable(); //Enable the Disabled button

        List<String> Array_To_Be_Replaced = new List<String>(); //This are the Values to be replaced, they will be stored in this array

        foreach (UltraGridCell cell in Gridstaff.DisplayLayout.SelectedCells)
        {
            if (cell.Column.Index == 0)
            {

                if (cell.Value != null && cell.Value.ToString() != "")
                {
                    cell.Style.ForeColor = System.Drawing.Color.Red;

                    Array_To_Be_Replaced.Add(cell.Value.ToString());

                }

            }

            else
            {

            }
        }
        Session["Array_To_Be_Replaced"] = Array_To_Be_Replaced;

    }

Now when my user is selecting the Staff, this page becomes very Slow.

Can you please advice me on the approach and the Bottleneck in my code.

Thank you

vuyiswamb 17 Posting Whiz

Good day All

I have a Challenge. I have the Following StoredProcedure that is doing the Following

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[temp]'))
drop table [temp]

--Creation of Temp1
SELECT MTN.ID,S.DESCR,ISNULL(MTN.CYCLETEMPLATE,C.CYCLES) AS CYCLETEMPLATE
into temp FROM TBL_STAFF S
INNER JOIN MTM_ACTV_STAFF MTN ON
S.ID = MTN.STAFF
LEFT OUTER JOIN tbl_Cycles_Staff C
ON C.IDL = MTN.ID

All this takes less than a second with (17672 row(s) affected)

and its Cool and it Bring records like this

ID              DESCR           CYCLETEMPLATE
===============================
7620	     Campbell P Dr	26
7620	     Campbell P Dr	27
7620	     Campbell P Dr	28
7620	     Campbell P Dr	29
7620        Campbell P Dr	      31
7621	      Jones D Dr	        23
7621	      Jones D Dr	        24
7621	      Jones D Dr	        26
7621	      Jones D Dr	        28
7621	      Jones D Dr	        29
7621	      Jones D Dr	        33
7621	      Jones D Dr 	       34

This is Cool, So now i want to Have one Campbell P Dr wilth all the CycleTemplate Feld on one line and not Duplicated and sepated by a "," So in Simple it Should be like this

ID              DESCR           CYCLETEMPLATE
===============================
7620	Campbell P Dr	26,2728,29,31
7621	Jones D Dr	23,24,26,28,29,33,34

So to do this i created a user defined function to Remove the Duplicates in a Table Level, the Function looks like this

/*This Userdefined Function is used to Remove Duplicates*/

ALTER FUNCTION [dbo].[DistinctList]
(
@List VARCHAR(MAX),
@Delim CHAR
)
RETURNS
VARCHAR(MAX)
AS
BEGIN
DECLARE @ParsedList TABLE
(
Item …
vuyiswamb 17 Posting Whiz

Good Afternoon lefrancisco1

You are using the Wrong event

use

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }

Hope it Helps


Vuyiswa Maseko

vuyiswamb 17 Posting Whiz

Good Morning All

For you to help me and understand my problem, i will have to explain everything in details.

I have a usercontrol with with a textbox, this texdtbox changes values so am trapping the values on textchange. so i have set it to "Autopostback="true"" in the usercontrol and whe this textbox changes its values i will to update the Ultrawebgrid in my hosting ASp.net 2.0 page that is not part of the Usercotrol. So i decided to expose the properties of the textbox and and the Postbackevent like this

in my Usercontrol

public bool
 TextBoxAutoPostBack

{


get
 {


return
 txtbxActvs.AutoPostBack;

}


set

{

txtbxActvs.AutoPostBack = 

value
;

and in my host page the usercontrol will have a property that i can turn autopostback to true or false , so i set it to true. Now Am not sure if the grid needs to have the same autopostback, because a normal Micorsoft gridview will not need to have that, as long as the textbox has the property autopostback is set to true automatically the grid will be updated.

Let me explain why is happening.

When the text changes in the usercontrol textbox , i want it to run a function that binds the Ultrawebgrid based on what is selected , i stepped through the function and it binds the grid, but now the Results does not show. i have other controls that are not related to this functionality, when i click one …

vuyiswamb 17 Posting Whiz

Let me Explain my Situation very clear and why am i doing this, i found a solution to this post now. I have a Textbox that is in a UserControl and u have set the autopostback to true and exposed the properties as i have showed above and access them and used them in the hosting page, now when this textbox changes its value the Grigview in the host page must change, now my problem is that one of them is behaving as autopostback="false" The reason am saying this is that if i touch something else that is not related to them , then the grid shows records

vuyiswamb 17 Posting Whiz

How do i use Autopostback Property that i got from a textbox in the usercontrol in the host page.

That is a Question :)

vuyiswamb 17 Posting Whiz

Good Day All

I have a textbox in a userControl and it has a Property "Autopostback" set to true, and as i know , this is encapsulated from the hosting page. now i need to set this property to true so that the Gridview in the Hosting page can recognize that the textbox of the usercontrol is set to true. I have added the following Properties from my User Control

public bool TextBoxAutoPostBack
    {
        get {
            return txtbxActvs.AutoPostBack;
            }
          set
          {
              txtbxActvs.AutoPostBack = value;
         
          }
    }

Now i need to use them in my hosting page.

Thanks

vuyiswamb 17 Posting Whiz

Good Day

I have a page that has a UserControl on it and i want to call a Method in the Host page that will fire when a textbox texchanged event got fire.

http://www.vbforums.com/attachment.php?attachmentid=71093&stc=1&d=1242811920

i want to Invoke the Function the the "Remove Staff " Button that has been Disabled has been clicked.

Thanks

vuyiswamb 17 Posting Whiz

Good Evening All

I have a web Application that is compiling well with no Errors, i have Compiled each separately and worked well excluding the setup Project. i have to be honest, i once use the clean before i rebuilded the Solution and i came across this challenge. here is the Error on VS2005

http://www.vuyiswamaseko.tiyaneprope...ot_Compile.JPG

And here is How my Project looks on the Solution Explorer

http://www.vuyiswamaseko.tiyaneprope...t_Explorer.JPG

Thank you

vuyiswamb 17 Posting Whiz

Good Afternoon All

I have a Control that looks like this

http://www.tiyaneproperties.co.za/fading_Control.JPG

And this Control looks differently from versions of Internet explorer. In 7 and up it shows are the links shows you and in internet explorer 6 it shows the whole of it , if the list grows, it create scroll bars

Questions
What is the Reason to that ?

Thank you

vuyiswamb 17 Posting Whiz

i have Resolved the Problem. Thank you. i did the Following

i created a UDF like this

CREATE FUNCTION GetCycle (@Descr Varchar(50))  
RETURNS Varchar(500)
AS  
BEGIN
Declare @RetStr as varchar(500),@Cycle Int  --<-- Assuming Cycle field  is of Type Integer

Declare TmpCur Cursor For select CyCle From YourTblName Where Descr=@Descr
Open TmpCur
Set @RetStr=''
Fetch Next From TmpCur Into @Cycle
While @@Fetch_status=0
Begin
		Set @RetStr = @RetStr + Case when @RetStr='' then '' else ' ' End + Cast(@Cycle as varchar)
	Fetch Next From TmpCur Into @Cycle
End
Close TmpCur 
Deallocate TmpCur 
return (@RetStr)
END

and Called the Function like this

Select Descr,.dbo.GetCycle(Descr) As Cycle From YourTableName Where Descr 
          in ( select Distinct Descr From YourTableName)

Thank you

vuyiswamb 17 Posting Whiz

Good Morning All

I have a table named “Final” with Values like this

ID     ||    DESCR              || CYCLE
======================================
1      ||	Earl G          ||   20
2      ||  	Earl G          ||   21
3      ||	Earl G 	        ||   22
4      ||	Davidson I Dr   ||   20
5      ||	Davidson I Dr   ||   21
6      ||	Davidson I Dr   ||   22
7      ||	Easton C        ||   20
8      || 	Easton C        ||   21
9      || 	Easton C        ||   22
10     ||	Edwards J Ms    ||   20
11     ||	Edwards J Ms    ||   21
12     ||	Edwards J Ms    ||   22

As you can see in the Description Field “Earl G” appears 3 times and it can be more than that. Now I want to append Cycles [cycle] strings to the corresponding description, I want to run a query so that this table may look like this

ID     ||    DESCR     || CYCLE
==============================================
1      ||Earl G        ||   20 , 21, 22
4      ||Davidson I Dr ||   20 , 21, 22
7      ||Easton C      ||   20 , 21, 22
10     ||Edwards J Ms  ||   20 , 21, 22

How can I achieve this in SQL


Thank you

vuyiswamb 17 Posting Whiz

That is a Good Post, Now What is the Attribute of the Button if it loses Focus ?

Thanks

vuyiswamb 17 Posting Whiz

Good Morning All

I have a Menu Control

<asp:Menu ID="Menu2" runat="server" BackColor="AliceBlue" BorderColor="SteelBlue"
            BorderStyle="Solid" BorderWidth="1px" DynamicHorizontalOffset="2" Font-Names="Verdana"
            Font-Size="8pt" ForeColor="Black" Height="20px" OnMenuItemClick="menureplace_MenuItemClick"
            StaticSubMenuIndent="10px" Width="87px">
            <DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
            <DynamicMenuStyle BackColor="White" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
            <StaticSelectedStyle BackColor="#5D7B9D" />
            <DynamicSelectedStyle BackColor="#5D7B9D" />
            <DynamicMenuItemStyle Font-Names="Verdana" Font-Size="10pt" ForeColor="#C00000" HorizontalPadding="5px"
                VerticalPadding="2px" />
            <Items>
                <asp:MenuItem Text="Replace selected" Value="Replace selected">
                    <asp:MenuItem Text="Confirm Replace" Value="Replace Selected"></asp:MenuItem>
                </asp:MenuItem>
            </Items>
            <StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
        </asp:Menu>

And This Menu Control works Fine outside the View Control. How can i make it work inside the View Control ?

Thank you

vuyiswamb 17 Posting Whiz

You need to Buy a Book learn Before you answer these Question, it is Clear that you did not attempt to buy a book.

We dont do homeworks for People Buy a Book

vuyiswamb 17 Posting Whiz

Thank you very much for your help.

The Problem is that the Database that i wanted to restore from was Corrupt.

Thank you

vuyiswamb 17 Posting Whiz

Good Morning Friends,

I have a SP that is Supposed to Restore a Database from a Backup. In some Clients this works well but in those particular client its a Problem. The version is SQL 2005.

Here is the Code that fails

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go




-- Restore a backed up database
-- Given: the filename and path where the backedup database file is located and the name of the database to restore it as
-- The entry will be restored and a row placed into oDirect.dbo.tbl_dbref - which keeps track of the databases
-- The users for the database must also be restored!
ALTER PROCEDURE [dbo].[sp_RestoreDatabase] 

	@dbname char(32), 				-- the database name to restore as
	@filename char(64), @path char(256)		-- the location of the backuped up database file	(on the SQL Server)

AS

set nocount on

declare @sql nvarchar(3000)

execute('sp_ClearDatabaseConnections ' + @dbname)

-- Restore the database
select @sql = 			' RESTORE DATABASE ' + ltrim(rtrim( @dbname )) + ' FROM DISK = ''' + ltrim(rtrim(@path)) + ltrim(rtrim( @filename )) + ''' ' 
select @sql = ltrim(rtrim(@sql)) + 	'    WITH RECOVERY, '
select @sql = ltrim(rtrim(@sql)) + 	'    MOVE ''' + 'TNGoedit_Data' + ''' TO ''' + ltrim(rtrim(@path)) + ltrim(rtrim( @dbname )) + '.mdf' + ''' , '	-- logical file name to physical name
select @sql = ltrim(rtrim(@sql)) + 	'    MOVE ''' + 'TNGoedit_Log' + ''' TO ''' + ltrim(rtrim(@path)) + ltrim(rtrim( @dbname )) + '_log.ldf' + ''' '	-- logical file …
vuyiswamb 17 Posting Whiz

tHANKS:)

vuyiswamb 17 Posting Whiz

hi sknake

I came up with this , and it seems to work

declare @S as nvarchar(63)
set @S = '10101010101010'

declare @NS as nvarchar(128)
set @NS=''
declare @Len as int
SET @Len = LEN(@S)

declare @Counter as int
SET @Counter = 1
WHILE @Counter < = @Len
BEGIN
	if (SUBSTRING(@S,@Counter,1)='1')
		set @NS = @NS + ' ' + convert(nvarchar,@Counter)
	SET @Counter = @Counter + 1
END
select @NS

what do you think about it

vuyiswamb 17 Posting Whiz

Good Day All

i have a table that carries a Field that has data like this

10101010101010

Now the Function that adds this 1's and 0's is working like this. If its selected insert "1" else "0", So if i can interpret the above if will be

1 3 5 7 9 11 13

the only thing that am interested in is "1's", if i can display their Position in a SQL Query i will be happy

i want to take these Values from a SQl table and Bind them to a Gridview. Remember the Number of Zeor's can increase , but the Limit is 63 including the "1's" and "0's".


Thank you

vuyiswamb 17 Posting Whiz

Again i cant Help you, until you post the code that brings Errors , the code above is just an html, is it the code that gives an Error ?

what does an error says ?

vuyiswamb 17 Posting Whiz

I dont see a Problem , you just posted html , what is your problem exactly ?

vuyiswamb 17 Posting Whiz

It can be a lot of things, We cant tell because we dont know what are you doing on Page load, mybe if you can tell us a list of things that you do onpage load event and post some sniped code , then we can help you. :)

vuyiswamb 17 Posting Whiz

Good Afternoon All

In all my Application, i used to write my login screen and i will not have a problem. i have inherited the ASP.NET Application that uses a login control.
Below are the pics of how it looks

here is a code for Forget Password link

protected void btnForgot_Click(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {

            PasswordRecovery1.Focus();

            multiviewLogin.ActiveViewIndex = 1;

            if (Login1.UserName != "")
            {
                PasswordRecovery1.UserName = Login1.UserName;
            }
        }
    }

and for Change Password code

protected void btnChangePassword_Click(object sender, EventArgs e)
    {
        ChangePassword1.Visible = true;
        if (Login1.UserName != "")
        {
            PasswordRecovery1.UserName = Login1.UserName;
        }
        
    }

Now my Problem is that when a user enters a username and password that are correct, and Click the "Forgot Password" button , it logged teh user in the system. It is doing the same thing as the "Change Password". But if i Crear the Username and Password textbox in the Login control it goes to the right place. So i have tried to crear them when the "Forgot Password Button is clicked and set them to empty strings, well for username its working, but for password i get an error that says the property is a Readonly

i tried to do them like this

if (!Page.IsPostBack)
        {
            /*Vuyiswa Added this to Prevent the Page from Bypassing the Login screen.
             * This was a bug Reporeted by University of freestate*/
            if (Login1.UserName != "")
            {

[B]                Login1.UserName = "";

                Login1.Password = "";[/B]
            }
            PasswordRecovery1.Focus();

            multiviewLogin.ActiveViewIndex = 1;

            if …
vuyiswamb 17 Posting Whiz

Thanks Guys,

Please look at this thread

http://www.daniweb.com/forums/thread173963.html

vuyiswamb 17 Posting Whiz

Good Morning All

I have a WebSetup Project and a Installer Class. I want to accept User

Database, Server,Username,Password and E-mail

This is what i did so far. I have created a Websetup Class installer that looks like this

namespace ClassLib
{
    [RunInstaller(true)]
    public class ClassLib : Installer
    {
        public override void Install(System.Collections.IDictionary stateSaver)
        {
            base.Install(stateSaver);

            // Retrieve configuration settings
            string targetSite = Context.Parameters["TargetSite"];
            string targetVDir = Context.Parameters["TargetVdir"];
            string targetDir = Context.Parameters["TargetDir"];

            if (targetSite.StartsWith("/LM/"))
                targetSite = targetSite.Substring(4);

            writeEventLogs();
            //adjust the web.config file.
            createConnectionString(targetSite, targetVDir, targetDir);
            //create ASP.Net 2 site...
            RegisterScriptMaps(targetSite, targetVDir);
            
        }

     

        void RegisterScriptMaps(string targetSite, string targetVDir)
        {
            // Calculate Windows path
            string sysRoot = System.Environment.GetEnvironmentVariable("SystemRoot");

            //get the latest .net framework directory
            DirectoryInfo di = new DirectoryInfo(sysRoot + "/Microsoft.NET/Framework");
            DirectoryInfo[] frameworkDir = di.GetDirectories("v2.0.*", SearchOption.TopDirectoryOnly);
            int big = 0;

            for (int i = 0; i < frameworkDir.Length; i++)
            {
                int current = Convert.ToInt32(frameworkDir[i].Name.Substring(5));
                if (current > big)
                {
                    big = current;
                }
            }

            string latestFramework = di.FullName + "\\v2.0." + big.ToString();

            // Launch aspnet_regiis.exe utility to configure mappings
            ProcessStartInfo info = new ProcessStartInfo();
            info.FileName = latestFramework + "\\aspnet_regiis.exe";
            info.Arguments = string.Format("-s {0}/ROOT/{1}", targetSite, targetVDir);
            info.CreateNoWindow = true;
            info.UseShellExecute = false;

            Process.Start(info);
        }

        void writeEventLogs()
        {
            //for debugging purposes write these values to eventlog.
            //EventLog.WriteEntry("o!Web Server", Context.Parameters["Server"]);
            //EventLog.WriteEntry("o!Web User", Context.Parameters["Username"]);
            //EventLog.WriteEntry("o!Web Password", Context.Parameters["Password"]);
            //EventLog.WriteEntry("o!Web Target Directory", Context.Parameters["TargetDir"]);
            //EventLog.WriteEntry("o!Web Target Site", Context.Parameters["TargetSite"]);
            //EventLog.WriteEntry("o!Web Virtual Directory", Context.Parameters["TargetVdir"]);
        }

        void createConnectionString(string targetSite, string targetVDir, string targetDir)
        {
            // Retrieve "Friendly Site Name" from IIS for TargetSite
            DirectoryEntry entry = new DirectoryEntry("IIS://LocalHost/" + targetSite); …
vuyiswamb 17 Posting Whiz

Are you missing a required referenced dll or COM Object?

no , people talk about GUI problems. no am not missing anything, here is the results when i use the detailed compilation

------ Rebuild All started: Project: DAL, Configuration: Release Any CPU ------
Build started 2/5/2009 4:49:26 PM.
Target _CheckForInvalidConfigurationAndPlatform:
  Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).
  Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).
  Task "Message"
    Configuration=Release
  Done executing task "Message".
  Task "Message"
    Platform=AnyCPU
  Done executing task "Message".
  Task "Error" skipped, due to false condition; ('$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')) was evaluated as ('bin\Release\' != '' and !HasTrailingSlash('bin\Release\')).
Target BeforeRebuild:
Target BeforeClean:
Target "SplitProjectReferencesByType" skipped, due to false condition; ('@(ProjectReference)'!='') was evaluated as (''!='').
Target "_SplitProjectReferencesByFileExistence" skipped, due to false condition; ('@(NonVCProjectReference)'!='') was evaluated as (''!='').
Target CleanReferencedProjects:
  Task "MSBuild" skipped, due to false condition; ('$(BuildingInsideVisualStudio)'!='true' and '$(BuildingSolutionFile)'!='true' and '@(_MSBuildProjectReferenceExistent)'!='') was evaluated as ('true'!='true' and ''!='true' and ''!='').
Target "UnmanagedUnregistration" skipped, due to false condition; (Exists('@(_UnmanagedRegistrationCache)')) was evaluated as (Exists('obj\DAL.csproj.UnmanagedRegistration.cache')).
Target CoreClean:
  Task "ReadLinesFromFile"
  Done executing task "ReadLinesFromFile".
  Task "FindUnderPath"
    Comparison path is "bin\Release\".
    Path "C:\Work Development\!Booking\TESTING\DAL\bin\Debug\DAL.dll" is outside the comparison path.
    Path "C:\Work Development\!Booking\TESTING\DAL\bin\Debug\DAL.pdb" is outside the comparison path.
    Path "C:\Work Development\!Booking\TESTING\DAL\obj\Debug\ResolveAssemblyReference.cache" is outside the comparison path.
    Path "C:\Work Development\!Booking\TESTING\DAL\obj\Debug\DAL.dll" is outside the comparison path.
    Path "C:\Work Development\!Booking\TESTING\DAL\obj\Debug\DAL.pdb" is outside the comparison path.
    Path "C:\Work Development\!Booking\TESTING\DAL\bin\Release\DAL.dll" is inside the comparison path.
    Path "C:\Work …
vuyiswamb 17 Posting Whiz

Your Subject is Misleading.

How did you deploy your Application. Please Explain step by Step , because if you have missed one simple step it will give you errors.

I dont use Wizards to do my database work, i can see that you have used a sqldatasource Control and really you dont have control over what is generated by the control. if you get an error that says you must declare scalar variable , you must know that one of the Variables in the Sql like @fName, am not sure how it works because i dont use it.

Hope i helped

vuyiswamb 17 Posting Whiz

Good Morning Guys

I have a Problem on my ASP.NET Application. I have a Web setup Project created and it used to work fine before, but now , when i try to Compile it it gives a Warning

"Object reference not set to an instance of an object"

And when i install the Application i get the Error. I have googled the Problem and solutions talked about sharepoint. but am just using a normal ASp.net 2.0 App.

Thanks

vuyiswamb 17 Posting Whiz

Wow , do you know why people ignore your post? :) its because what you are saying is not related to VB.NET or why have not try enough to explain what is your problem and what you want to achieve

vuyiswamb 17 Posting Whiz

Remember that an IP Adress can be used interchangably with the DNS name. So instead of writting the name of the Server, you just have to write in the IP Adress, there is nothing else Special. Every Computer must have a name, especially a Server, why dont you tell your Support guys to provide you with the name of that Server.

vuyiswamb 17 Posting Whiz

what is your Question Exactly, try to be in details

vuyiswamb 17 Posting Whiz

This is not a Right Place to post Articles. There should be Articles Section. You are confusing the users

vuyiswamb 17 Posting Whiz

Why would you wanna do that ?

vuyiswamb 17 Posting Whiz

First you must buy a Book, i think every .NET Books that i have ever read they cover that part .

http://www.codeproject.com/KB/cs/NTier.aspx

http://www.codeproject.com/KB/cs/N-Tier22.aspx

http://www.codeproject.com/KB/vb/N-Tier_Application_VB.aspx

Thank you

vuyiswamb 17 Posting Whiz

We dont do homeworks for people , we Help People who have started something and get stucked. Start Something and get stucked and we will help you

vuyiswamb 17 Posting Whiz

I really Dont know what you are talking about, If you are trying to use a Copy of VS then you are screwd buy a Original Copy

Thief

vuyiswamb 17 Posting Whiz

So what you want is to Simply Clear the Grid ?

If so if you are using a Dataset , you just have to say

Dataset.Clear();
DataTable.Clear();

Simple ne

vuyiswamb 17 Posting Whiz

yes the guys are Right, it must look like this

if (cn.State == ConnectionState.Closed)

Thanks

vuyiswamb 17 Posting Whiz

Username is already a property of the profile set to readonly, are you trying to add a property or use the current one?

if you need to add a new property, change it to something else like loggedinuser

Thank you very much

It worked

vuyiswamb 17 Posting Whiz

right click on the project and click set as startup project

also might want to try restarting visual studio

Thanks for the Reply. I think i tried it and it does not work. the Strange thing is that when i run the Project it shows the Correct Project that i have set as a Startup in VS, but the Strange thing is that after i comppile the Setup Project , it Shows the First Project that is in the Solution Explorer.

vuyiswamb 17 Posting Whiz

Good evening Everyone

My VS is behaving n an unnormal way. I have 9 Project in a Solution and i have set one of the Projects as a Startup Project and created a Setup project, after i Built it to create an exe, The Project that gets Started is not the one that i set as a Startup. The Strange this is that the Project that start is the first in the list(Solution Explorer). i rebuilt the Setup Project but still no luck. I went to the Solutions Properties and i made Sude that the Project is Selected as a Startup object, but still my Project is not selected as a Startup

What is Wrong :(

vuyiswamb 17 Posting Whiz

Thank you very much :)

vuyiswamb 17 Posting Whiz

Thank you , its working

vuyiswamb 17 Posting Whiz

Good Evening alL

I have an ASP.NET Front end that seaches the Dates in certain Ranges. here is my Data Layer.

public DataTable Get_Date_by_Month(String Username,String Datefrom, String Dateto)
        {
            con = new OleDbConnection(strcon);

            DataTable Details = new DataTable();
            
            da = new OleDbDataAdapter();

            cmdselect = new OleDbCommand();

            cmdselect.CommandTimeout = 0;
            
            cmdselect.CommandText = "SELECT [Details].[Transportation],[Details].[HOUSING], [Details].[FEEDING], [Details].[UTILITIES], [Details].[INSURANCE],[Details].[TELECOMMUNICATION],[Details].[Entertainment],[Details].[FUEL],[Details].[CLOTHING],[Details].[EDUCATION],[Details].[Miscellaneous],[Details].[BASIC_INCOME], [Details].[OTHER_INCOME] FROM [Details] INNER JOIN USERS  ON Details.[P_ID] = [USERS].[ID] Where Details.Username = ? And Details.[DATE] Between  ?  AND ? ";
            
            cmdselect.CommandType = CommandType.Text;

            cmdselect.Connection =con;

            da.SelectCommand = cmdselect;

            da.SelectCommand.Parameters.Add("[Username]", OleDbType.VarChar, 30).Value = Username;
           
            da.SelectCommand.Parameters.Add("[DATE]",OleDbType.Date, 30).Value = Convert.ToDateTime(Datefrom).ToShortTimeString();

            da.SelectCommand.Parameters.Add("[DATE]", OleDbType.Date, 30).Value = Convert.ToDateTime(Dateto).ToShortTimeString();

             
            try
            {
                con.Open();

                Details.Clear();

                da.Fill(Details);
                

            }
            catch(OleDbException)
            {
                throw;
            }
            finally
            {
                con.Close();
            }
            return Details;
        }

but now if i try to Search between Valid Ranges, it Brings nothing to the DAtagrid. Am Using Access 2003Thanks

vuyiswamb 17 Posting Whiz

You are right :)

Thanks :):D

vuyiswamb 17 Posting Whiz

hi

its My birthday today, am not Writting code :);) :D :D :twisted: :cool: :icon_lol:

vuyiswamb 17 Posting Whiz

Good Evening Guys, Today its my Birthaday.

I have a If statement that i use to return an integer that will mean Success or Failure , now am testing for that integer in my ASP.NET 2.0 Page lke this

if (Res == 1)
        {

          
 Response.Write("<script> alert('You have Successfully Registred');</script>");
           

 Response.Redirect("login.aspx", false);
        }
        else
        {

          
          
Response.Write("<script> alert('Invalid Data has been Entered');</script>");
       

        }

Now if the value is 1, then it should Display the Message and after the Message has been Clicked it should move to the login Page. Now my Problem is that it moves to the Login Page without a Alert Message being Displayed And the send Alert for invalid Entry, will not show anythingm, there is a Warning sign on my Page at the Bootom left of my Page. What is wrong with my Javascript

Thanks