|
I'm posting just to let you know of a few 'updates'. I haven't changed the code yet, but I will soon enough, and I'll inform you then.
At the moment:
1. 'shootName' is used but not in that code extract. It's in the same method, but it's set in a if...else situation, which is irrelevant
2. I'm not sure if this is my misconception or anything, but I had rather thought that if an object is set to null, this makes GC more likely/quickly to occur on that object, to release the resources occupied by it? If this is my mistake, than I'm glad to know
3. I'll check TempSaveStream() again to ensure that it's not causing the problem.
Furthermore, I WILL check the exception handling, due to the embarrassing exception handling I've implemented in the other conversation we've had
Besides, I will check certain properties in the ZipFile class, since, for instance, there is a particular property that once the child's finished, it also closes the parent zip. So it may be something along those lines
Thanks for taking the time I'll keep you informed
|
|
|
|
|
suppose i have two table table1 & table2. now how can i sync the data of two table of sql server using microsoft sync frame work or using any other class.
tbhattacharjee
|
|
|
|
|
You can use "Instead Of" or "After" triggers on those tables for Insert, Update and Delete actions.
For example:
<br />
USE YourDatabase<br />
<br />
CREATE TRIGGER Table1_AfterDelete <br />
ON Table1 AFTER DELETE<br />
AS<br />
DELETE Table2 WHERE Table2.Id IN (SELECT Id FROM DELETED)<br />
GO<br />
<br />
CREATE TRIGGER Table1_AfterInsert <br />
ON Table1 AFTER INSERT<br />
AS<br />
INSERT INTO Table2 SELECT * FROM INSERTED<br />
GO<br />
<br />
CREATE TRIGGER Table1_AfterUpdate <br />
ON Table1 AFTER UPDATE<br />
AS<br />
UPDATE Table2<br />
SET Table2.FirstName=Table1.FirstName, Table2.LastName=Table1.LastName<br />
FROM Table2 JOIN Table1 ON Table2.Id=Table1.Id<br />
GO
|
|
|
|
|
While stonehearts answer is technically correct, I would question your data structure if you are storing the same data in 2 tables. I suggest you do some research into normalising your database (said with absolutely no knowledge of your data structure).
Besides triggers are EVIL and should be avoided unless they are essential.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
have create a dynamic menu but problem is that how we give for a page link in clildnodes.
my code is like that---------------------------------------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class top : System.Web.UI.Page
{
SqlConnection conn;
DataUtility dut = new DataUtility();
protected void Page_Load(object sender, EventArgs e)
{
PopulateMenu();
}
private void PopulateMenu()
{
DataSet ds = GetDataSetForMenu();
Menu menu = new Menu();
menu.MenuItemClick += new MenuEventHandler(menu_MenuItemClick);
foreach (DataRow parentItem in ds.Tables[0].Rows)
{
MenuItem categoryItem = new MenuItem((string)parentItem["Catname"]);
menu.Items.Add(categoryItem);
foreach (DataRow childItem in parentItem.GetChildRows("Children"))
{
MenuItem childrenItem = new MenuItem((string)childItem["Subcatname"]);
categoryItem.ChildItems.Add(childrenItem);
}
}
Panel1.Controls.Add(menu);
Panel1.DataBind();
}
void menu_MenuItemClick(object sender, MenuEventArgs e)
{
string selected = e.Item.Text;
Response.Write(selected);
}
private DataSet GetDataSetForMenu()
{
conn = dut.getConnection();
SqlDataAdapter adCat = new SqlDataAdapter("SELECT tbl_Category.* FROM tbl_Category,tbl_Usercat where tbl_usercat.uid=1 and tbl_Category.sno=tbl_Usercat.catid", conn);
SqlDataAdapter adProd = new SqlDataAdapter("SELECT tbl_SubCategory.* FROM tbl_SubCategory,tbl_UserSubcat where tbl_UserSubcat.UID=1 and tbl_SubCategory.sno=tbl_UserSubcat.SubCatid", conn);
DataSet ds = new DataSet();
adCat.Fill(ds, "tbl_Category");
adProd.Fill(ds, "tbl_SubCategory");
ds.Relations.Add("Children", ds.Tables["tbl_Category"].Columns["sno"], ds.Tables["tbl_SubCategory"].Columns["CatID"]);
return ds;
}
}
so plz help me soon.
thanks
vivek
|
|
|
|
|
Why have you posted this more than once? Is it a blatant attempt to bump your post to the top? You must think we're idiots - by doing this, you pretty much guarantee that people aren't going to want to help you. There's an etiquette involved in the forums, and you've just disregarded it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Never mind he posted in the wrong forum..
|
|
|
|
|
Hi,
There is a vertical ToolStrip in my application. ToolStrip buttons are dynamically added. When number of added control increases, all controls that overflows comes into a menu . Is there any way to add a scrollbar or scroll button into the toolstrip to avoid this overflow menu.
Thanks in Advance
|
|
|
|
|
You can use a panel.
1- Place a panel on your form and dock it for example to left
2- Set the AutoScroll Property of panel to True.
3- Place your Toolstrip in your panel.
4- Set the AutoSize Property of ToolStrip to True and LayoutStyle to VerticalStackWithOverflow Or Table or Flow.
|
|
|
|
|
have create a dynamic menu but problem is that how we give for a page link in clildnodes.
my code is like that---------------------------------------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class top : System.Web.UI.Page
{
SqlConnection conn;
DataUtility dut = new DataUtility();
protected void Page_Load(object sender, EventArgs e)
{
PopulateMenu();
}
private void PopulateMenu()
{
DataSet ds = GetDataSetForMenu();
Menu menu = new Menu();
menu.MenuItemClick += new MenuEventHandler(menu_MenuItemClick);
foreach (DataRow parentItem in ds.Tables[0].Rows)
{
MenuItem categoryItem = new MenuItem((string)parentItem["Catname"]);
menu.Items.Add(categoryItem);
foreach (DataRow childItem in parentItem.GetChildRows("Children"))
{
MenuItem childrenItem = new MenuItem((string)childItem["Subcatname"]);
categoryItem.ChildItems.Add(childrenItem);
}
}
Panel1.Controls.Add(menu);
Panel1.DataBind();
}
void menu_MenuItemClick(object sender, MenuEventArgs e)
{
string selected = e.Item.Text;
Response.Write(selected);
}
private DataSet GetDataSetForMenu()
{
conn = dut.getConnection();
SqlDataAdapter adCat = new SqlDataAdapter("SELECT tbl_Category.* FROM tbl_Category,tbl_Usercat where tbl_usercat.uid=1 and tbl_Category.sno=tbl_Usercat.catid", conn);
SqlDataAdapter adProd = new SqlDataAdapter("SELECT tbl_SubCategory.* FROM tbl_SubCategory,tbl_UserSubcat where tbl_UserSubcat.UID=1 and tbl_SubCategory.sno=tbl_UserSubcat.SubCatid", conn);
DataSet ds = new DataSet();
adCat.Fill(ds, "tbl_Category");
adProd.Fill(ds, "tbl_SubCategory");
ds.Relations.Add("Children", ds.Tables["tbl_Category"].Columns["sno"], ds.Tables["tbl_SubCategory"].Columns["CatID"]);
return ds;
}
}
so plz help me soon.
thanks
vivek
|
|
|
|
|
Is there a way to open multiple pdf files, via c# please?
|
|
|
|
|
|
Hi.
Can I use RequireFieldValidator control to check for the blank data? There, both of the two textboxes must not be blank. But it'll be ok if only one of these two textbox must be entered data. If with RequireFieldValidator, how can I use with it?
Thanks.
|
|
|
|
|
Strictly speaking, this question should be in the ASP.NET forum, and no - a required field validator validates that a field is required, not that one of two fields is required. You'll need to write a custom validator.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
This is a repost; it's already posted in the .NET Framework forum. Please be patient and don't spam the forums with the same question.
You can check out the PictureBox [^], you could adapt that to suit your needs.
|
|
|
|
|
I wanna sample demo for streaming media player in C# on WinCE, does anybody has?
Or can anyone tell me how to do that?
|
|
|
|
|
Hello everyone
Please tell me how many positive value give the signed integer in sql
Thanx in advance
|
|
|
|
|
Sure thing ... first post your question here[^] otherwise see here[^]
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
1. Your question is not clear - please reword.
2. If this really is a question about SQL then this is not the appropriate forum.
|
|
|
|
|
|
I presume you mean for the web?
If so i'd guess the VisibleMonthChanged event...
or do you want to determine whether it is the next month or the previous?
|
|
|
|
|
Hello All,
I've got a problem with EntLib 4.1 in combination with my config file.
I have a class library for data access which has its own app.config file containing the information for the sql connection.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<dataConfiguration defaultDatabase="CarOmnia" />
<connectionStrings>
<add name="CarOmnia" providerName="System.Data.SqlClient" connectionString="server=(local);database=CarOmnia;User Id=xx;Password=xxxx;" />
</connectionStrings>
</configuration>
Code to access the database:
public static DataSet SelectAll()
{
DataSet retValue = new DataSet();
try
{
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStoredProcCommand(stpTest);
retValue = db.ExecuteDataSet(cmd);
}
catch (Exception ex)
{
throw ex;
}
return retValue;
}
With this go the following includes:
using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
What am i doing wrong, i'm getting the following error on the CreateDatabase() line:
{"The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, null]) failed: The value can not be null or an empty string. (Strategy type ConfiguredObjectStrategy, index 2)"}
|
|
|
|
|
I had the same problem the other day....
Does the config file that is in the project root directory differ from the one in the Debug directory? If I remember correctly, VS overrites the config file every time you compile or change some settings in the file.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Checked that already, unfortunately they are the same
|
|
|
|