Showing posts with label generating. Show all posts
Showing posts with label generating. Show all posts

Friday, February 24, 2012

cannot insert null

i am using asp2003 and sql server 2000. in my SQL Server i am generating a field city_id automatically by incrementing the value by 1 and it is the primary key. so when i insert any data using my asp.net application it works fine on my system but it gives me error when i upload it to the web server. the error is

Cannot insert the value NULL into column 'city_id', table 'nevadb.nevauser.city_master'; column does not allow nulls. INSERT fails. The statement has been terminated.

any help?

Are you sure that city_id is an auto incrementing field on the production server? Have you double-checked that?

|||

Try to set this option before you insert data to the table:

SET IDENTITY_INSERT OFF;

INSERT ....

|||yes. this is the problem... actually when i copy my database from my computer to web server using import/export utility of sql server 2000. then it do not copy all the checks (in my case identity). even import/export utility do have option to copy identity values but it is not working the way it should be. can you suggest any solution to me. some one told me that i have to write some kind of script and run it on the server. does anybody have any idea, what i shoul do to resolve this problem.|||well i found the solution... i created sql queries and run it on the server through query analyser. SQL queries can be automatically generated through the enterprise manager, by right clicking on a particular table>>> all tasks >>>> Genetare SQL Script.....
Thank you every body for replying

Friday, February 10, 2012

cannot find page when generating the report

I click a button to preview the report. The link is

http://localhost/rpt/report_order_summary_cust&rs:Command=Render&rc:Parameters=False&cust_code=cctest&supp_code=%&from_date=2005/01/01&to_date=2007/01/01

I got two file in the rpt folder. they are named as report_order_summary_cust.rdl.data and report_order_summary_cust.rdl.

I wrote a function to generate the report which is

1const string RS_NAME ="report_order_summary_cust";2const string RS_CMD ="&rs:Command=Render&rc:Parameters=False";3string rs_para;4string rs_url;56//parameters7string para_cust_code = lblSelectedCustCode.Text;8string para_supp_code = ddl_supplier.SelectedValue;9string para_from_date = txtFromDate.Text;10string para_to_date = txtToDate.Text;111213RSPath = rtn_http_dir(RSPath);14para_from_date = Convert_date(para_from_date);15para_to_date = Convert_date(para_to_date);161718string[] arr_cust_code = para_cust_code.Split(';');1920for (int index=0; index < arr_cust_code.Length; index++)21{22string cust_code = arr_cust_code[index].ToString().Trim();23rs_para ="&cust_code="+ cust_code +24"&supp_code="+ para_supp_code +25"&from_date="+ para_from_date +26"&to_date=" + para_to_date ;27rs_url = RSPath + RS_NAME + RS_CMD + rs_para;282930string script ="<SCRIPT LANGUAGE='JAVASCRIPT'> window.open('" + rs_url +"','_blank','height=700, width=1050, top=0,left=0,toolbar=no,menubar=no, scrollbars=yes, location=no, status=no');</SCRIPT>";31Page.RegisterStartupScript("Script_" + index.ToString(), script);3233}

When i click the button the above code will be run. However, the pop up windows show that the page cannot be found. I would like to know what problem it is? (I am now to reporting service)

I am using vs2003 + server 2000 reporting service

Thank you.

have you tried url encoding the link. Those dates could cause you problems.