|
5'd - everything you said here makes sense. Occasionally it is good to step back and look at the problem being solved and all your points are valid. I don't know why you have been downvoted.
|
|
|
|
|
Thanks
Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim
So Smile Please
|
|
|
|
|
Make sure you have rows. Do like:
if(dt.Rows.Count > 0 )
{
ar.Add(dt.Rows[0]["EmailColumnName" OR Index no].ToString());
ar.Add(dt.Rows[0]["FaxColumnName" OR Index no].ToString());
if( ar[0].Contains("@") )
}
If you are looking something else then let me know.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Hi,
I have installed VS 2008 and SQL Server 2008 Enterprise edition. I basically want to add my database to my website. in the App_Data folder right click and find my database(.mdf). the problem is after hitting enter I got this error.(Access Denied)
does any one has any solution,pleas.
|
|
|
|
|
SQL Server Enterprise? You're running a server OS on your development machine?
All you need is SQLExpress. If you look at the machine.config you will see the default connection string is to a SQLExpress instance.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Assuming that you have to attach the mdf as a static file in your project due to licensing on the SQL Server or for some other reason can't deploy the MSSQL server to your deployment environment, you should perhaps look into using SQLLite and not MSSQL. Clickey
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
thanks for your reply, guys.
i have done the following steps:
I installed VS2008 and MSSQL2008;
I design database and its table in SQLServer2008.
I don't installed SQLExpress.
now, I am developing an MVC Web Application;
the problem is when right click in App_Data folder and choose existing item to add the created database in SQLServer2008, get this error: Access Denied.
Could you please tell me what is the problem? is there any solution to remove fix this error without installing SQLExpress?
|
|
|
|
|
SQl Express is not an answer. Your problem is that you cannot connect a db the way your are trying to. You have to create objects that connect with the SQL Server. You are getting Access Denied because SQL Server owns and controls the file.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Hi,
I create an ODBC Driver and find my databse; in VS2008, in Server Explorer I add my database(ODBC.Dell.Test)
I just get confuse; in MVC I have to add my database in App_data(is it true?)if yes, how?
because, again when I add that object get the same problem(Access Denied)
|
|
|
|
|
Hi All,
I have XML string as below. I am trying to deserialize this xml string in to a Request Object or NewHire Object. I have designed the Request class as it holds
the instance of NewHire class as a public property. I did in two ways
1. First time when I tried for the Request type it was giving exception like error in identifying property NewHire.
2. Then I deleted the Request element from the xml and kept from NewHire to /NewHire part only and then tried to deserialize the object for the NewHire type.
Then its not giving the exception but all the values in the NewHire instance it is giving null. Its not reading the values.
XML File :
----------
string strXML = "" + "<Request>" + "<NewHire>"
+ "<CompanyCandidateCode>CandCode</CompanyCandidateCode>"+ "<SSN>SSS</SSN>"
+ "<LastName>6456</LastName>"+ "<FirstName>3434</FirstName>"
+ "<MiddleName>676</MiddleName>"+ "<EthnicGroup>546456</EthnicGroup>"
+ "<Address>tuituiu</Address>"+ "<City>dfgfd</City>"
+ "<State>ghjgjg</State>"+ "<Zip>345345</Zip>"
+ "<HomePhone>bvnbvn</HomePhone>"+ "<OtherPhone>234234</OtherPhone>"+ "</NewHire>"+ "</Request>";
Deserialize Code:
----------------
try
{
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(Request));
System.IO.TextReader reader =
new System.IO.StreamReader(new MemoryStream(ASCIIEncoding.Default.GetBytes(strXML)));
Request ObjItems;
ObjItems = (Request)serializer.Deserialize(reader);
reader.Close();
string str = Convert.ToString(ObjItems.NewHire.Address);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
I want to read this in to my Request or NewHire objects any of the above two methods ok. I prefer for the first one to fill the Request ojbect but if it can fill only NewHire
object and cant fill an object containing another object, I will adjust with NewHire only.
Can anybody please help me in this regard as I have to deserialize it in anyway.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
This article[^] should help, particularly the section Complex Object Serialization. It's all about the attributes.
|
|
|
|
|
Hi Gray,
I dont know your First Name to call but really it helped me a lot. Thanks for the excellent help. I am going to rate it very very excellent.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
I want to create (or borrow if one exists) a "news ticker" for our website that aggregates RSS feeds from vendors and news outlets into a section of our webpage. I want to maintain the functionality of being able to click through to the stories as you would when using an RSS reader. Is there something out there that already exists and I'm just not looking for the right thing? I know I've seen this on other websites and was just wondering if this is something that every website has developed on their own? Any help is much appreciated, thanks!
|
|
|
|
|
When I don't pass certain value in textbox. It gives me above exception.
Here's the code.
cmd.Parameters.Add("DOB", SqlDbType.SmallDateTime).Value = txtDOB.Text;
I want to ignore NULL values. How to tackle this problem.
I know it should have been easy. But anyhow, I stuck .
Regards
Asif Rehman
|
|
|
|
|
If the value in txtDOB.Text is a null or whitespace character, you need to set Value to DBNull.Value .
|
|
|
|
|
thanks for quick response.
So to my best understanding, I can replace
old phrase
cmd.Parameters.Add("DOB", SqlDbType.SmallDateTime).Value = txtDOB.Text;
with this one
cmd.Parameters.Add("DOB", SqlDbType.SmallDateTime).Value = (string.IsNullOrEmpty( txtDOB.Text)) ? DBNull.Value.ToString() : txtDOB.Text;
Is there any way shorter to do this.
Regards
Asif Rehman
|
|
|
|
|
I normally use a utility method like this:
public static object GetValueForParameter(string value)
{
if (!string.IsNullOrWhitespace(value))
return value;
return DBNull.Value;
} Then you can replace your code with cmd.Parameters.Add("DOB", SqlDbType.SmallDateTime).Value = Utility.GetValueForParameter(txtDOB.Text);
|
|
|
|
|
Thanks. It works.
Regards
Asif Rehman
|
|
|
|
|
You're welcome. Thanks for letting me know.
|
|
|
|
|
hi guys,
i just developed an easy ajax enabled page. but whenever i execute an ajax script i get an error:
'Access is denied'.
this site is running on the server and accessing it from my local machine.
is there anyone who knows why my ajax calls to the server are being denied?
Please help me.
Regards,Morgs
|
|
|
|
|
|
hi guys,, i want to open a model popup extender when a row inserted to the particualar table
now i can open a model popup window manually but i want it to be done automatically if a row inserted to the table in sql server 2005
Please let me know as soon as possible
Ahamed Azeem
software Programmer
|
|
|
|
|
if u want to do it from codebehind, make your main div to runat="server" so that you can access it from codebehind.
e.g.
After the code for inserting a new row executes the very last thing u must now do is to show the modal.
e.g.
public void InsertTableRow()
{
popupModal.Style.Value = "display:block;";
}
hope that helps...
|
|
|
|
|
You can use Open() method of ModalPopupExtender in code behind when new row is added.
|
|
|
|
|
Hi,
I am developing ASP.net and VS2010; I am using MVC; I right click on Model Folder to choose an Data Model; just wondering to know what is difference between Dataset and SQLServerDatabase?
|
|
|
|