|
I have tried both these two ways that mentioned in msdn website but i couldn't find any propery pages dialog box in View.It doesn't work. Kindly pls advise what's going on? Do I need to change some setting?
Default script is always JavaScript.
flowerppk
|
|
|
|
|
dear all;
i am so much confused .... actually i want to do a small project that shows around 180 offices name and when ever we click on the collapsible panel a panel will be expanded and gives the details of the clicked office.( from the database).. the details are ( like telephone,email,specifications... etc)
so how i can do this.. if we use a user control with collapsible panel it will hamper the page so much i.E the page load will be so much heavy....
pls help in that .. any suggestions..............pls pls i am urgent regarding this
|
|
|
|
|
omerqq wrote: if we use a user control with collapsible panel it will hamper the page so much i.E the page load will be so much heavy....
If the information is same for all user load the data in the Cache, so it will not hit database every time to retreive user information and data population will be fast.
|
|
|
|
|
Well you could load the data...wait..."pls pls i am urgent regarding this". Sorry, don't respond to rude requests like this. It may be urgent to you but not the rest of us.
only two letters away from being an asset
|
|
|
|
|
Are you going to show 180 offices in a single page or will you use pagination? Surely if you are going to show 180 offices and its related information which comes from the database, your page load will be affected as far as the performance is concerned.
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
Hi!
I have 2 tables in MS SQL database - one is just ID and Description of an Client Type, the other is ID, name, address and ClientType_ID. I have a GridView which is binded with SqlDataSource. The select statement returns all. I have made on the place of the ClientType_ID to be shown a DropDown List with the Description of the Client Type, not the ID, so the user can choose from it. I've enable on my SqlDataSource update, insert & delete statements. I was hoping when I edit the GridView and change the value in the DropDown List that it will update the table. But not only that didn't happend, but I have this error:
Incorrect syntax near 'nvarchar'.
Is anyone has any suggestions how to update the ClientType_ID in the table with the names of the clients, but choosing from the Description, not the ID of the ClientType?
What's with this error?
10x in advance!
This is the gridView and the sqlDataSource
<pre> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LegalConnectionString %>"
SelectCommand="SELECT * FROM [Clients]" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [Clients] WHERE [ClientID] = @original_ClientID AND [ClientType] = @original_ClientType AND [First Name] = @original_First_Name AND [Last Name] = @original_Last_Name AND (([BULSTAT] = @original_BULSTAT) OR ([BULSTAT] IS NULL AND @original_BULSTAT IS NULL)) AND (([Telepohone number] = @original_Telepohone_number) OR ([Telepohone number] IS NULL AND @original_Telepohone_number IS NULL))" InsertCommand="INSERT INTO [Clients] ([ClientType], [First Name], [Last Name], [BULSTAT], [Telepohone number]) VALUES (@ClientType, @First_Name, @Last_Name, @BULSTAT, @Telepohone_number)" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Clients] SET [ClientType] = @ClientType, [First Name] = @First_Name, [Last Name] = @Last_Name, [BULSTAT] = @BULSTAT, [Telepohone number] = @Telepohone_number WHERE [ClientID] = @original_ClientID AND [ClientType] = @original_ClientType AND [First Name] = @original_First_Name AND [Last Name] = @original_Last_Name AND (([BULSTAT] = @original_BULSTAT) OR ([BULSTAT] IS NULL AND @original_BULSTAT IS NULL)) AND (([Telepohone number] = @original_Telepohone_number) OR ([Telepohone number] IS NULL AND @original_Telepohone_number IS NULL))">
<DeleteParameters>
<asp:Parameter Name="original_ClientID" Type="Int32" />
<asp:Parameter Name="original_ClientType" Type="Int32" />
<asp:Parameter Name="original_First_Name" Type="String" />
<asp:Parameter Name="original_Last_Name" Type="String" />
<asp:Parameter Name="original_BULSTAT" Type="String" />
<asp:Parameter Name="original_Telepohone_number" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ClientType" Type="Int32" />
<asp:Parameter Name="First_Name" Type="String" />
<asp:Parameter Name="Last_Name" Type="String" />
<asp:Parameter Name="BULSTAT" Type="String" />
<asp:Parameter Name="Telepohone_number" Type="String" />
<asp:Parameter Name="original_ClientID" Type="Int32" />
<asp:Parameter Name="original_ClientType" Type="Int32" />
<asp:Parameter Name="original_First_Name" Type="String" />
<asp:Parameter Name="original_Last_Name" Type="String" />
<asp:Parameter Name="original_BULSTAT" Type="String" />
<asp:Parameter Name="original_Telepohone_number" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ClientType" Type="Int32" />
<asp:Parameter Name="First_Name" Type="String" />
<asp:Parameter Name="Last_Name" Type="String" />
<asp:Parameter Name="BULSTAT" Type="String" />
<asp:Parameter Name="Telepohone_number" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1"
ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataKeyNames="ClientID">
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
Text="Select"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ClientID" HeaderText="ClientID" InsertVisible="False"
ReadOnly="True" SortExpression="ClientID" />
<asp:TemplateField HeaderText="ClientType" SortExpression="ClientType">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList6" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Description" DataValueField="ClientType">
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:DropDownList ID="DropDownList5" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Description" DataValueField="ClientType" OnSelectedIndexChanged="DropDownList5_SelectedIndexChanged" SelectedValue='<%# Bind("ClientType") %>'>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="First Name" HeaderText="First Name" SortExpression="First Name" />
<asp:BoundField DataField="Last Name" HeaderText="Last Name" SortExpression="Last Name" />
<asp:BoundField DataField="BULSTAT" HeaderText="BULSTAT" SortExpression="BULSTAT" />
<asp:BoundField DataField="Telepohone number" HeaderText="Telepohone number" SortExpression="Telepohone number" />
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<EmptyDataTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Description" DataValueField="ClientType" SelectedValue='<%# Eval("Description") %>' Width="155px">
</asp:DropDownList>
</EmptyDataTemplate>
</asp:GridView>
Help please!!
|
|
|
|
|
Hello,
I want to store cookies of multiple user logged in different times on same pc.
Is this possible?
Thanks in advance
Regards,
Milind
|
|
|
|
|
milindchavan12 wrote: Is this possible?
Create the key containing the username.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
Hi Devs,
I have couple of button in a form and sometimes when i click on it, instead of jumping to button1_click it jumps to one of the dropdownlist1_SelectedIndexChanged and generates error and application fails. And this doesn't happen every time but it is happening randomly.
Any idea what's going wrong here ??
Thank You
Andyyy
|
|
|
|
|
Are you sure the action occuring behind the button click event isn't, under specific circumstances, changing the selected index in the drop down list, (i.e., maybe it's filtering or repopulating the items in the the drop down list), and thus firing the index changed event entirely appropriately as the selected index has actually changed?
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
Good point. I will have a look if that's the case.
Thanks
|
|
|
|
|
Hi,
Just check the event binding of the specified control.
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
considering hosting website on vmware? advantage is i can snapshots and if suspect security breach i can always revert back to a prev snapshot (or i can even do this say weekly)?
downside is of course it's slow[er]
anyone with experience in this?
dev
|
|
|
|
|
Its fine for testing purpose, but i will recommended not to use in production environment. Because for speed of server. I don't know the configuration of your server. If backup is the only reason to use VMware, you can use other tools to backup. . This is my personal opinion.
|
|
|
|
|
but being able to restore snapshot say weekly (or even daily) really gives peace of mind any security breach won't linger too long...
dev
|
|
|
|
|
devvvy wrote: downside is of course it's slow[er]
Well, it depends on how you configure the VM.
In a ideal case, the pefromance should ot differ from a physical server.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
there's got to be difference, just how much and how much is acceptable...
you done this in a prod env before? I am contemplating doing this for a low-medium traffic shopping site.
dev
|
|
|
|
|
This is an insane idea. You can install all sorts of backup software on your server that does what VMWare does with snapshots.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
no not just disk backup - what if your box has been hacked and you don't know what it is? If I can say even restore snapshot on say monthly basis - I can have the peace of mind my system is *clean*.
I'm considering this for a site with low-medium traffic - if speed is concern then I can buy faster hardware to compensate.
dev
|
|
|
|
|
devvvy wrote: no not just disk backup - what if your box has been hacked and you don't know what it is? If I can say even restore snapshot on say monthly basis - I can have the peace of mind my system is *clean*.
You can backup your entire system with tools like Ghost, on a regular basis, and you can restore the hard drive to that state, just like a snapshot.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi all,
I developed workflow application in .NET with framework 3.5,
I Put 2 interactivity in workflow as A1 and A2,
A1 is connected to A2, And A2 is last activity,
But when I run application first time it gives me following error,
"Value cannot be null. Parameter name: workflowType"
Please help me urgent,
Thanks in Advanced,
Bhushan
|
|
|
|
|
Bhushan M Jsohi wrote: But when I run application first time it gives me following error,
"Value cannot be null. Parameter name: workflowType"
Its very difficult to say the reason with out your code. You are passing any parameter named workflowType which is passed as a null. So verify your code.
BTW : This is not related with ASP.NET, you need to post it over here WPF/WCF/WWF Forums
|
|
|
|
|
we completed the registration page in our project and whatever the details we have given in that registration page they are also going to update in the backend also. but whatever the username and password we have given in the registration page is not accepted by the login page.while giving the username and password it is showing the error like below
object reference is not set to an instance of an object
code i have written for registration page
bal data = new bal();
data.FirstName = Text_FirstName.Text.Trim();
data.LastName = Text_LastName.Text.Trim();
data.Gender = Text_Gender.Text.Trim();
data.EmailId = Text_EmailId.Text.Trim();
data.UserName = Text_UserName.Text.Trim();
data.Password = Text_Password.Text.Trim();
data.ConfirmPassword = Text_ConfirmPassword.Text.Trim();
data.Country = ddlCountry.SelectedItem.ToString();
data.State = Text_state.Text.Trim();
data.City = Text_City.Text.Trim();
data.Dob = DateTime.Parse(Dob.Value);
data.PhoneNumber = Text_PhoneNumber.Text.Trim();
data.MobileNumber = Text_MobileNumber.Text.Trim();
data.Currentlocation = Text_Currentlocation.Text.Trim();
data.PreferedJobLocations = Text_Location.Text.Trim();
data.JobCategory = ddljobcategory.SelectedItem.ToString();
data.KeySkills = Text_KeySkills.Text.Trim();
data.HighestQualificationheld = ddlhqh.SelectedItem.ToString();
data.SpecialisationMajor = ddlspecialisation.SelectedItem.ToString();
data.Institute = ddlinstitute.SelectedItem.ToString();
data.YearPassedOut = ddlyrpassedout.SelectedItem.ToString();
try
{
int res = data.insertreg();
if (res > 0)
{
Page.RegisterStartupScript("SS", "<script> alert('Completed Successfully');</script>");
}
else
{
lblmessage.Text = "registration failed";
}
}
catch
{
}
i have used 3 tier architecture
the code in the dal layer for registration page
static SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ToString());
internal static int insertreg(bal bal)
{
//throw new NotImplementedException();
con.Close();
con.Open();
SqlCommand cmd = new SqlCommand("sp_reg", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@FirstName", bal.FirstName);
cmd.Parameters.AddWithValue("@LastName", bal.LastName);
cmd.Parameters.AddWithValue("@Gender", bal.Gender);
cmd.Parameters.AddWithValue("@EmailId", bal.EmailId);
cmd.Parameters.AddWithValue("@UserName", bal.UserName);
cmd.Parameters.AddWithValue("@Password", bal.Password);
cmd.Parameters.AddWithValue("@ConfirmPassword", bal.ConfirmPassword);
cmd.Parameters.AddWithValue("@Country", bal.Country);
cmd.Parameters.AddWithValue("@State", bal.State);
cmd.Parameters.AddWithValue("@City", bal.City);
cmd.Parameters.AddWithValue("@Dob", bal.Dob);
cmd.Parameters.AddWithValue("@PhoneNumber", bal.PhoneNumber);
cmd.Parameters.AddWithValue("@MobileNumber", bal.MobileNumber);
cmd.Parameters.AddWithValue("@Currentlocation", bal.Currentlocation);
cmd.Parameters.AddWithValue("@PreferedJobLocations", bal.Currentlocation);
cmd.Parameters.AddWithValue("@JobCategory", bal.JobCategory);
cmd.Parameters.AddWithValue("@KeySkills", bal.KeySkills);
cmd.Parameters.AddWithValue("@HighestQualificationheld", bal.HighestQualificationheld);
cmd.Parameters.AddWithValue("@SpecialisationMajor", bal.SpecialisationMajor);
cmd.Parameters.AddWithValue("@Institute", bal.Institute);
cmd.Parameters.AddWithValue("@YearPassedOut", bal.YearPassedOut);
cmd.Parameters.AddWithValue("@type", "i");
try
{
return cmd.ExecuteNonQuery();
}
catch
{
throw;
}
finally
{
con.Close();
cmd.Dispose();
}
}
}
code i have written for login page
protected void Button1_Click(object sender, EventArgs e)
{
loginbal data = new loginbal();
data.userid = txt_userid.Text.Trim();
data.password = txt_password.Text.Trim();
DataSet ds = new DataSet();
ds = data.getuserID();
}
}
the code in the dal layer for registration page
static SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ToString());
internal static DataSet GetUserID(loginbal loginbal)
{
//throw new NotImplementedException();
con.Close();
con.Open();
SqlCommand cmd = new SqlCommand("sp_login", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@userid",loginbal.userid);
cmd.Parameters.AddWithValue("@password",loginbal.password);
cmd.Parameters.AddWithValue("@type","s");
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
try
{
return ds;
}
catch
{
throw;
}
finally
{
cmd.Dispose();
con.Close();
}
}
}
|
|
|
|
|
sritha wrote: object reference is not set to an instance of an object
And what line is that error occurring?
sritha wrote: catch
{
}
This is bad practice - Don't do it.
sritha wrote: try
{
return ds;
}
catch
{
throw;
}
finally
{
cmd.Dispose();
con.Close();
}
WTF?
Exactly what exception will return ds throw? Surely the try block should go around everything, not just the last line.
You are not doing anything in the catch block other than rethrowing the exception. Remove the catch block it is not required.
Your connection is stored elsewhere. .NET does connection pooling, don't keep connection objects around, create a new one each time.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|