|
pavanip wrote: i am using that email address as foreign key for remaining tables.
If you are useing this as a foreign key, when you try to update or delete that record in registration and there is a record in table 2, then you get this error, you would also need to update or delete the record from table 2 before updating or deleting in table registration
To resolve this, just enable the cascadeupdate and cascadedelete in table registration for the email column
Alexei Rodriguez
|
|
|
|
|
Please be carefull while using cacadedelete on the table.
this may trouble you if you are usiung the trigger. when a record is being deleted.
Thanks & Regards
Pete
|
|
|
|
|
Hi friends
I will be having hardly 100 names in the DB ( My SQL)
I have written a web-service which returns the matching names
Everything is fine except the speed , Please any suggestions regarding increasing speed .
Thanks and Regards
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
cache what you wanna fetch
|
|
|
|
|
Thanks "Phil Uribe" & "J4amieC" for their kind attention on my problem. But I could not get the required result.My problem is still same. By using the following code I got the full path not only file name.
protected void Page_Load(object sender, EventArgs e)
{
string s = "select picture from tiff";
string str = Path.GetFileName(s);
SqlDataAdapter da = new SqlDataAdapter(str, con);
DataSet ds = new DataSet();
da.Fill(ds,"tiff" );
datalistl.DataSource = ds.Tables["tiff"];
datallist.DataBind();
}
Note: I am using datalist and in edit template I used link button to show the file name.
|
|
|
|
|
ahmad25 wrote: Thanks "Phil Uribe" & "J4amieC" for their kind attention on my problem. But I could not get the required result.My problem is still same.
Then you should reply in the already existing thread instead of starting a new.
ahmad25 wrote: string s = "select picture from tiff";
string str = Path.GetFileName(s);
As the string s doesn't contain a file path, using it in a call to GetFileName doesn't give you any meaningful result.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
ahmad25 wrote:
string s = "select picture from tiff";
string str = Path.GetFileName(s);
SqlDataAdapter da = new SqlDataAdapter(str, con);
DataSet ds = new DataSet();
da.Fill(ds,"tiff" );
What is this supposed to return??
You are calling the fill method with "" as you sqlcommand
path.getfilename("c:\\x\myfile.jpg") returns the extension of a file
Alexei Rodriguez
|
|
|
|
|
Hi all,
I am trying create a websetup project for my website. My requirements are
1. I have to check whether SQL Server 2005 is exist in the Client System . If not exist, the setup should terminate.
2.Registration key validation, for that I have to generate a key1 this will be shown in registration form(in label) to user, then user have to enter key2(In a text box). I have to validate the key2 entered by the user.
3. Providing desktop short cut icon. If user clicks on icon, it should open home page of my website.
4. Providing Programs menu shortcut, functionality same as above 2.
5. After copmpletion of installation, i have to show Reade document by providing Button[ReadMeFile] ,if user hits this button i have to open the ReadMe Document.
6. I have move My DataBase files(.ldf &.mdf) to directory [Program Files]\Microsoft SQL Server\MSSQL.1\MSSQL\Data , I have to change the Connection string of my web.config page.
7. I heve to Insert Some values into DataBase table.
8. If any thing fails, i have to roll back/uninstall all files.
Please suggest me how to do websetup for above my requirements.
Thanks in advance.
|
|
|
|
|
Try the Following
I assume that you know to add custom actions for a web setup.
follwing are the answers (Piont wise).
1. Use SQLDMO Namesspase for detecting the sql server. (You can add a form to the Installer for user to speciy the server name, or you can read the system where you are trying to install.)
2. For this step you have to add a action script again and a user interface form.
3. you can use a option of desktop shortcut folder. (Drag the home page. and drop in the desktop shortcut folder.)
4. repeat the step 3. but drop in program shortcut folder.
5. you can user readme dailod. or use a custom action to launch the file either in notepad or word pad.
6. You can convert whole MDF file to a sql script. and Using SQLDMO you can execute the script on the selected instance in step 1.
7. Using SQLDMO run the scripts for inserting the values.
8. rolling back is handled automatically by the installer (But customaction exceptions should be handled carefully).
Thanks & Regards
Pete
|
|
|
|
|
|
Wowwww
It really works!!!
Alexei Rodriguez
|
|
|
|
|
I am trying to setup a site where I connect to an SAAS system via an iframe in my default.asp page. However I seem to be having troubles getting the iframe to pass a variable in the URL.
Here's what I'm trying to do. If I click on the following link, I am immediately logged in as a guest at the SAAS site. Just pasting the link in my browser works correctly.
http://www.mywebapp.com/home/login.asp?FromLogin=1
However, if i use the same URL an iframe, it doesn't seem to pass the variable because I end up at the login page.
<iframe src="<a href="http://www.mywebapp.com/home/login.asp?FromLogin=1">
Can anyone provide a suggestion? This is driving me nuts!
Thanks in advance for your help!
|
|
|
|
|
Hello Everybody .
I am creating a custom control and i am trying to make it raising events
i inherited from IPOSTBackEventHandler interface and implemented its method
but in vain , the control still doesn't have any effect when it is clicked on the page
the code for the control is as follows
<br />
public class CustomButton : Control , IPostBackEventHandler , IPostBackDataHandler<br />
{<br />
public event EventHandler Click;<br />
<br />
protected override void Render(HtmlTextWriter writer)<br />
{<br />
writer.Write("<input type="\"Submit\"" name="\"ClickButton\"" value="\"Click" me="" mode="hold" /> }<br />
<br />
#region IPostBackEventHandler Members<br />
<br />
public void RaisePostBackEvent(string eventArgument)<br />
{<br />
OnClick(new EventArgs());<br />
}<br />
protected virtual void OnClick(EventArgs e)<br />
{<br />
if (Click != null)<br />
Click(this, e);<br />
}<br />
<br />
#endregion<br />
<br />
#region IPostBackDataHandler Members<br />
<br />
public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)<br />
{<br />
Page.RegisterRequiresRaiseEvent(this);<br />
return true;<br />
}<br />
<br />
public void RaisePostDataChangedEvent()<br />
{<br />
<br />
}<br />
<br />
#endregion<br />
}<br />
<br />
What is the problem
Human knowledge belongs to the world.
|
|
|
|
|
Hi All,
Is'nt there a RichTextBox(Like in WinForms)for Asp.Net? What can i use to show some logactions from the database?
Thanx.
|
|
|
|
|
Hi,
I have a web app in asp.net 1.1 . I've created resource files (.resx), and need to add images to it that can then be displayed using the html img tag. How do I load images into .resx files? Should I be loading the image or a path to an image?
Also, I'd like to place all resource files in a sub-directory in the root, and then have them be compiled and placed in a dll in the bin dir. How do I do this? As of now, the only option I see is that I place all the .resx files in the root, and VS will compile them, and place them in a dll in the bin folder. I'd like to see the many .resx files in a dir of their own. How do I do this, and have the vs compiler find them?
Thanks.
Shefali
|
|
|
|
|
I have created a custom gridview control programatically and added checkbox to the template field.below are the steps followed to add the template filed to the gridview
TemplateField tempField = new TemplateField();
tempField.ItemTemplate = new GridViewTemplate(DataControlRowType.DataRow, "TemplateField");
tempField.HeaderTemplate = new GridViewTemplate(DataControlRowType.Header, "TemplateField");
grvGridView.Columns.Add(tempField);
public class GridViewTemplate : System.Web.UI.Page, ITemplate
{
private DataControlRowType fTemplateType;
private string fColumnName;
CheckBox rowCheckBox;CheckBox headerCheckBox = new CheckBox();
public GridViewTemplate(DataControlRowType type, string colname)
{
fTemplateType = type;
fColumnName = colname;
headerCheckBox.ID = "hdrCheckBox";
}
public void InstantiateIn(System.Web.UI.Control container)
{
switch (fTemplateType)
{
case DataControlRowType.Header:
container.Controls.Add(headerCheckBox);
break;
case DataControlRowType.DataRow:
rowCheckBox = new CheckBox();rowCheckBox.ID = "chkUserCheckBox";
container.Controls.Add(rowCheckBox);
break;
}
}
}
once the gridview is bound checkbox is getting rendered perfectly .. but once i select the checkboxes and click button i am unable to locate the checkboxes in the gridview ... getting error(Object Reference not set to an instance) at the lines of code numbered below
CLICK EVENT OF BUTTON
{
foreach(GridViewRow gvr in GridView.Rows)
{
1. CheckBox chkbox = (CheckBox)(gvr.FindControl("chkUserCheckBox")) // First Way tried to get the reference of checkbox
2. CheckBox chkbox = (CheckBox)gvr.Cells[0].Controls[0] // Second Way tried to get the reference of checkbox
}
}
Can anyone please help me resolving the issue .
|
|
|
|
|
Hi friends,
I have to create a Message board. I'm planning to create a class for this, whick is going to include a collection of messages. This is the general idea:
MessageBoard Class
UserId
Collection of Messages
AddMessage()
RemoveMessage(messageID)
MarkAsRead(messageID)
MarkAsUnread(messageID)
Message Class
MessageBoardId
Text
Read
I have read some about Collections I saw some examples where they use ArrayList, SortedList and CollectionBase among others for this. What do you think is the most suitable Collection type to use in this case?
Thanks a lot
|
|
|
|
|
Is there a possibility to include horizontal scroll bar in asp.net 2.0 List box control? though i tried out many possibilities, i couldn't find out..Have got any idea about this? Thanks in advance.
Muthu
|
|
|
|
|
Put the control in a div tag perhaps.
I didn't get any requirements for the signature
|
|
|
|
|
Well, I tried even putting a div element with its scroll property set to auto. Was helpless.!?!
Muthu
|
|
|
|
|
some properties to try setting on your div tag.
style="width:300px; display:block; overflow: scroll; height:200px;"
I didn't get any requirements for the signature
|
|
|
|
|
Instead of div, you can also use a panel control and set the corresponding properties like haight and scrollbars
Alexei Rodriguez
|
|
|
|
|
thanks a lot, that works fine.
Muthu
|
|
|
|
|
I want a js function using confirm js function to determine whether the user wants to exit the current page, by the onunload js event.
That is when user unloads a page, there must be a confimation, whether user really wants to exit.
When i press ok, i must retain the current page. if cancel is clicked then current page must be closed.
any sample piece of code available..Thanks for reading..
Muthu
|
|
|
|
|
See the js function in the post message here at codeproject
If you have something writen and try to go back or toa new page, it asks you if you really want to do that
Alexei Rodriguez
|
|
|
|