|
Error Type:
Microsoft JET Database Engine (0x80040E21)
Index or primary key cannot contain a Null value.
/Poonam/updated.asp, line 73
----------------------------------------------------------------------------
this is my update file
<% dim month, day, year, gender,OStats,DStats,SStats,arrVals,arrAll,rs,usr,strSql,strdes,strinter,strfavm,strquote,strfavs,status
gender = Request.Form("Gender")
month = Request.Form("DOBMonth")
day = Request.Form("DOBDay")
year = Request.Form("DOBYear")
'arrAll = split(Request.Form ("allBoxes"), ",")
'get the array with the id's that were ticked
'arrVals = split(Request.Form ("chkbox"), ",")
'rs("Looking to")= '& arrVals &'
Looking = Trim(Request.Form("ckbox"))
status = Request.form("lovestatus")
OStats = Request.Form("orientationStatus")
DStats = Request.Form("drinkerStatus")
SStats = Request.Form("smokerStatus")
strdes = Request.Form("description")
strinter = Request.Form("interests")
strfavs = Request.Form("favoriteSongs")
strfavm = Request.Form("movies")
strquote = Request.Form("quote")
'Build connection
usr=Request.QueryString("nm")
set conn = server.CreateObject ("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("users.mdb")
set rs = server.CreateObject ("ADODB.Recordset")
'Open record with entered username
rs.Open "select * from userlist where username='"& usr &"'", conn, 3, 3
rs.AddNew
rs("username") = usr
rs("password") = var
rs("fullname") = var2
rs("country") = var3
rs("fld_question") = var4
rs("fld_answer") = var5
rs("fld_email") = var6
rs("fld_visitor_ID") = var7
rs("dd") = day
rs("mm") = month
rs("yy") = year
rs("Status") = status
rs("Looking_to") = Looking
rs("Gender")=gender
rs("Favourite_Quote")= strquote
rs("Favourite_Movie")= strfavm
rs("Favourite_Bands") = strfavs
rs("Sexual_Orientation") = OStats
rs("Smoker") = SStats
rs("Drinker") = DStats
rs("Interests") = strinter
rs("About_me") =strdes
'Save record
rs.Update
set rs=nothing
set conn=nothing
%>
|
|
|
|
|
Hi
Thsi is posible only when you PK Field is Identity or some before insert trigger is taking the responsibility of updating the PK filed.
Regards
Tushar kothari
|
|
|
|
|
Is it possible to create a system.data.datatable or dataset from an excel worksheet that is obtained using interop.excel in C#?
The code is as following. As you can see, I can read/modify certain cell, but is it possible to convert the table to a System.data.datatable? Or at least print out the select range in the excelworksheet?
using System;
using Excel;
protected void OpenExcelSpreadSheet(string input)
{
Excel.Application excelApp = new Excel.ApplicationClass();
excelApp.Visible = false;
Excel.Workbook newWorkbook =
excelApp.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
// The following code opens an existing workbook
object Missing = System.Reflection.Missing.Value;
string workbookPath= "myFile.xls";
Excel.Workbook excelWorkbook =
excelApp.Workbooks.Open(workbookPath,Missing,Missing,Missing,
Missing,Missing,Missing,Missing,Missing,Missing,Missing,Missing,Missing,Missing,Missing);
// The following gets the Worksheets collection
Excel.Sheets excelSheets = excelWorkbook.Worksheets;
// The following gets Sheet1 for editing
string currentSheet = "Sheet1";
Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet);
// The following gets cell A1 for editing
Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range("A1", "A1");
excelCell.Value2 = input;
Excel.Range excelTable = (Excel.Range)excelWorksheet.get_Range("A1", "A27");
int noOfRow = excelTable.Rows.Count;
int noOfColumn = excelTable.Columns.Count;
Response.Write("Table has " + noOfRow + " rows and " + noOfColumn + " columns.
");
}
|
|
|
|
|
I still use Visual Interdev for web sites, as I know it well. My question is this - at what point should a database be used rather than a flat file? I ask this as I have found a flat file is much faster and requires fewer overheads, particularly when I only need to search through a few hundred items. I appreciate a database must be used where the data is large, but when do you reach this point? Say for example I need to hold names and addresses, where is the break point – 300, 1000, 5000 items?
Rod
|
|
|
|
|
If you want to change the data, a database is very helpful. If you use a flat file, you have to use some locking mechanism to ensure that noone reads the file while you are changing it. A database handles this automatically.
If you use a database you can normalize the data. That reduces redundancy in the data, which reduces the risk for inconsistencies.
A database already knows how to filter and sort the data, things that you have to build yourself if you use a flat file.
A database scales much better than a flat file. If you expect the number of records to grow, you should go for the scalability. Besides, the performance really isn't an issue until it's an issue...
If you feel that you won't need any of these features, then you can stick to a flat file.
---
b { font-weight: normal; }
|
|
|
|
|
Don't laugh at me, but I've been curious for a while about how a forum like this saves the msgs/posts/articles? Do they use database or flat files?
Thanks!
|
|
|
|
|
Sorry, I did actually chuckle a little bit.
A database, of course.
I really didn't go into this much, as your application didn't seem complex enough to mention it:
If you have more than one type of object and/or objects that are related to each other (like users - message boards - postings - articles...), there is no question about it. You should use a database.
---
b { font-weight: normal; }
|
|
|
|
|
I might have gone off the topic. But if I wanna create something like outlook Calendar which can be shared online by a group of people, database is still a better choice, right? Thanks.
|
|
|
|
|
Hi,
I am trying to access an image from the server, it is visible in the browser, but if i try to provide any querystring parameters the url defuaults to something else, i wanted to know what could be the reason for this behaviour.
e.g.
when i try to access
http://server_/Images/Img01.jpg
works
but
http://server_/Images/Img01.jpg?xyz=1
doesnot work
pls advice
Regards,
Sivaprasad
|
|
|
|
|
Hi Friends,
Can we use SOAP services in classical ASP? not in Asp.NEt
scenario being
let say we got 10 web sites among whic
some sites are in Classical ASP and some are in ASP.Net.
we want to built a centeralised login system for both ASP.Net and classical ASP sites.
and I dont want to open databse connections and stuff for those 10 sites.
My idea is making web services and use them.
Any idea or articale giving the solution is welcome.
thanks
Naveed Kamboh
|
|
|
|
|
You can - a webservice call is just a normal POST (or GET)...
the difficulty is that SOAP requires the data to be packaged in to an "envelope". It's not that hard to do, but you'll have a lot of string manipulation to do.
As an aside, if you think it'll help, there's a javascript client side soap lib article on CP somewhere
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
I am getting below error below
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
while trying open the project available from
http://www.codeproject.com/useritems/DynamicForm.asp
does anyone have had similar problem before
thanks
|
|
|
|
|
Go to IIS right-click on your web page, select properties and click on the "Create application" button. That should fix the problem.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
The application is already configured. would there be a problem that my web dev express edition of visual studio doesnt support c# application. if thats the case how will i be able to fix it.
|
|
|
|
|
Hi!
I have installed both version of visual studio 1.1 and 2.0
my all project which are in 1.1 are fine when i open in 1.1 framework.
i downloaded a web dev express and tried to open a project that was created in 2.0 and it gives me
following error
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
i checked the virtual directory in IIS and in project properties i changed the application pool to
asp.net 2.0
deleted the backup file in cache but still receive this error
it also gives me few warnings they are
could not find schema information for element 'dataconfiguration' and
could not find schema information for element 'defaultdatabase'
please help this is byfar my first project in asp.net 2.0 running in visual studio 2005
thanks
|
|
|
|
|
What css attribute do I add to make this image display at the top of the table? Does it matter what the actual size of the image is to answer this question or accomplish my task? I could look up the actual size of the image, but it is bigger than 100 x 100 px. The image currently is displaying in 1/2 way down the table cell.
<table border="1" cellpadding="3" cellspacing="3"><br />
<tr><br />
<td ><br />
<img src="xxx.jpg" style="width: 100px;height:auto;"/><br />An image<br />
</td><br />
</table><br />
I reviewed some CSS books and googled "images in tables" but cannot find the answer. It hopefully is simple answer?
|
|
|
|
|
Hi!
if you are deailing with IE 5.x or above the following style statements can solve your problem. Do not forget to adjust the cell's height and width according the size of the image. This statement places the image behind the cell. Therefore, you can add text or another image inside the cell as well.
I hope it workes out for you!
|
|
|
|
|
Simplest would be to make the td valigned : <td valign="top"><img></td>
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hello!
How is the syntax of defined array in below in javascript (The equivalent)?
Dim ProLabels(26,5)
ProLabels(1,1) = "Hello"
ProLabels(2,1) = "Hi"
Prolabels(1,2) = "How are you?"
Thanks
|
|
|
|
|
Javascript tutorial[^]
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
led mike
|
|
|
|
|
Hello
I have created a user defined table inherited from Datatable,and a custom row inherited from Datarow while sending across webservice i have added them to a dataset. Now i can receive the dataset on my client but when i am trying to refer the table it is a datatable instead of the custom one
Can some one help???????? ??????
blue
|
|
|
|
|
You have to cast it to your custom type.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Nope it isn't that straight forward i did tired that as well
blue
|
|
|
|
|
Hiya all.
I hope this is the right part of the forum, because I couldn't see any other section where this might fit.
I'm trying to investigate why a specific website is crashing often.
The site is running on IIS 6.0 and .net 1.1.
My main suspect is that the site often throws "System.Threading.ThreadAbortException" (which are caught and logged) due to an apparently extensive use of Response.Redirects.
Now I've read on some MSDN article that IIS6.0 and .net 2 combined with this exception could cause the IIS thread pool to recycle and thus - well go down and cause the website to "reboot" loosing sessions etc.
But while this site is running on IIS 6.0 it is running using 1.1 framework. Does anybody have experience with the same bug while running on 1.1, or should I think outside the box.
Apparently the code has already been searched through for unclosed connections to the DB which shouldn't be the issue, and frankly, I can't see why DB connections should cause the IIS thread pool to be affected. If anything the system would just hang as far as I'd figure it.
Thanks in advance.
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
I have read that there can be a periodic problem when reading large varchar or text fields from SQL server (or memo fields from Access) using ASP--they can sometimes come up as empty strings. (See http://www.aspfaq.com/show.asp?id=2188.)
What I have been unable to find out is whether this problem is still around in recent versions of MDAC (>= 2.8). Does anyone know whether this problem still occurs--is it still necessary to follow the steps in that aspfaq article?
|
|
|
|