Databases :: Sql Cursor Pulls In All Nulls For Every Field In Every Row?

Mar 19, 2010

I am using a cursor to iterate through a small set of record (28), perform some maths on each record and then update the record / row.

The problem is the cursor pulls in all nulls for every field in every row

It also gives me 28 rows, 28 times (see below)

[code]......

View 1 Replies


Similar Messages:

Databases :: NoNullAllowedException: Column 'idNames' Does Not Allow Nulls

Apr 12, 2010

environment: VS2008, MySQL 5.1.45, .net Connector 6.2.2

Error msg:

NoNullAllowedException: Column 'idNames' does not allow nulls.

The MySQL DB has on "idNames" (Primary Key) a tick-mark for: primary Key, Not Null, Auto-Increment Also: I can add/retrieve records via the 'MySQL Query Browser'; I see the data via VS2008 'Preview Data'!

As said in the comment below; when the 'idNames' is explicitely given the rows.add works fine. So it seems that I miss something around the 'auto-increment' business!

[code].....

View 2 Replies

Databases :: Detecting Nulls In Output Parameter Using ODP?

May 17, 2010

I'm converting my application from using System.Data.OracleClient to Oracle.DataAccess.Client and I've noticed some weird behavior.

I am calling a stored procedure that sets an output parameter value. Under some circumstances, a null value gets assigned to this value and I need to detect it.

Here's how I'm declaring it using ODP.net:

cmd.Parameters.Add("p_status", OracleDbType.VarChar2, 200, DBNull.Value, ParameterDirection.Output)

The old Microsoft driver for Oracle would read the value as an empty string. However, ODP is returning a value {null} (per Visual Studio's debugger), which is not equivalent to null, DBNull.Value, nor an empty string. As a result, the code doesn't branch correctly now.

View 1 Replies

DataSource Controls :: Setting Field To Nulls Not Working - LINQ With Listview

Jan 6, 2011

I have a Listview with a LinqDataSource. I am allocating a resoure called Bladder Scanners to clinicians on the day selected. The field in the database, 'Allocated_Bladder_Scanner_Id', allows nulls. The 'nullable' property of the field in the dbml is set to allow nulls.In the edit template, I have an unbound dropdownlist (drpBladderScannerDropdown) with an 'empty string' item added to cater for nulls, and
AppendDataBoundItems="true".In order to show only bladder scanners which have not yet been allocated on the selected day, I am databinding the dropdownlist to a dictionary of unallocated bladder scanners in the ItemDataBound event. I then add the currently selected bladder scanner as a listitem and set it as the selected item. So far, so good, all works well. However, if the clinician has a bladder scanner currently allocated, and then the user elects to not allocate the clinician a bladder scanner on that day by selecting 'Nothing' from the dropdownlist, the LinqDataSource fails to update the field. It does not throw an exception, it just doesn't set the field to nulls. In ItemUpdating I have the following code:

[Code]....

View 1 Replies

Forms Data Controls :: In The SQL Server The 'phone' Field Is Set To 'varchar(30)' And Nulls Are Allowed?

May 18, 2010

My filter Expression was working fine with filtering by Control Parameters.When I added the Phone Parameter it went nuts - with the Phone Parameter the GridView just Comes out blank upon loading the page (without it would show Select * from Individuals)Is it because the phone field is populated with numbers? Don't get it.... In the SQL server the 'phone' field is set to 'varchar(30)' and nulls are allowed.here is my code:

[Code]....

View 4 Replies

Databases :: Oracle Stored Proc Optionally Returning A Ref Cursor?

Feb 22, 2010

I would like to use a technique for exception handling on our database stored procs whereby, each proc exposes a p_error_code output parameter of type int. 0 indicates no error, and other values indicate application specific exceptions. Now, where a stored proc will return a ref cursor if no exceeptions occur, we would like to check the p_error_code and if not 0, then use the ref cursor. If an exception does occur, then the stored proc may or may not have populated the ref cursor, but the dotnet code will almost definately not read the contents.

OracleCommand command = CommandFactory.CreateCommand(transaction, "RTS.p_get_audit_trail");

View 5 Replies

AJAX :: Move CURSOR Using From One Component To Another But When Cursor At Ajax Combox It Does Not Working For Combo?

Dec 16, 2010

public void ModifyEnter()
{
combo1.Attributes.Add("onkeydown", "if(event.which || event.keyCode)" +

[code]...

View 1 Replies

Security :: Only Pulls First Rolegroup In List?

Jan 11, 2010

I have a very simple page that displays a link for each rolegroup that a member belongs to with ASP.NET membership, lets say Group1 and Group2. For some reason, I can only see the first of two links in a list, regardless of which group it is.

I've already verified that both groups are pulling in fine by moving the Group2 link above Group1 to see if it could be viewed: which it was!

If Group1 is listed above Group 2, I see the link to Group1. But if I move the link for Group2 above Group1, I see the Group 2 link. I don't have a bunch of snazzy-dazzy complicated code on this page, so I'm stumped. Why could this be happening? Here is my code:

[Code]....

View 5 Replies

Databases :: Put In The Host Field , It Says 172.6?

Jul 6, 2010

i'm new here , and i'm a beginner with asp.net.well ,i've created an authentification page.the data are stored in a table in the orcl database.i haven't really figured out how to connect to orcl : i've seen a way with description in the tnsnames.ora file,but in don't know what should i put in the host field , it says 172.6.but i don't know if it exact.

View 2 Replies

Have A Page In My Application That Pulls The Links From The Database?

Jul 29, 2010

I have users input links (like file paths and web pages links) to a database via a form. When they put file paths (e.g C:Program Files...) it stores them properly.However, I have a page in my application that pulls the links from the database so that the user can click on those links. For links which include spaces (like the one I just used as an example) it replaces the space with %20 ... This messes up my link and it doesn't work. How can I fix this?-I number records that are saved into my database in a specific way. I have an ID for each record which is a two digit number. For number that are low (1-9) I would like it to display as 01, 02, 03, etc. But if I save it in that form into the database, it goes from 01 to 1.How can I fix this? Users need to see it as 01, 02, etc...

View 6 Replies

ADO.NET :: How To Write A Query That Pulls Records From A Master Table

Mar 18, 2011

Being new to Linq and Entity Framework, I find myself struggling to write queries that are relatively simple in SQL. My latest challenge is how to write a query that pulls records from a master table and includes a column for aggregating data from related detail records. Let's start with this example:

List<Customer> list = (from x in Customer select x.Customer_ID, x.CustomerName).ToList();

Now I'd like to modify this so that I include a column indicating how many orders each customer has, where there is a one-to-many relationship between the Customer and Order entities. I suspect the solution might result in a List of an anonymous type rather than the List of Customer like my example, but that would be

View 1 Replies

Databases :: How To Receive An Individual Field From MySQL

Aug 21, 2010

I was wondering how to receive an individual field from my MySQL database.

I have been able to get a row, but what I am trying to do is get a name from my database and set it into the HeaderText in my DataGrid.

The way I am trying to do it at the moment is

[Code]....

This doesn't seem to get a value from the GetValue, but if use

[Code]....

it will bind my data into the grid.

I just want to be able to change the HeaderText in the first coulmn of the DataGrid from one table and have the DataGrid be filled from another table.

I can fill the DataGrid its just changing the HeaderText that I am having trouble with.

View 1 Replies

Databases :: Csv Import Truncating Values In Only 1 Field?

Oct 19, 2010

Not that it should matter.. the 2nd value in the csv is an IP address.. its in the file as 192.168.7.25(just an example), but gets read as 192.1687, if the file is setup as delimited in the connection string, does that have any restraints on the data being read? When i open the file in notepad, the comma is at the end of the IP address, when i open it in excel it is in its own column.. so what could be causing this? Because of this issue with the truncation, that is what is causing the primary key issue.. because there are other values that are similar like these:

192.168.7.25
192.168.7.26
192.168.7.45

because if the issue, it passes each one of those as 192.1687 Here is the table structure, in case it helps resolve this issue.

[id] [int] NOT NULL,
[IpAddress] [varchar](16) NOT NULL,
[MacAddress] [varchar](16) NULL,
[APTypeId] [int] NOT NULL,
[APUser] [varchar](256) NULL,
[APPass] [varchar](128) NULL,
[APLocation] [varchar](20) NULL,
[APFreq] [varchar](50) NOT NULL,
[APBand] [varchar](50) NOT NULL,

View 5 Replies

Databases :: Parameterized Query And Date Field?

Sep 17, 2010

[Code]....

This is a query to an old FoxPro database on a server (Same Network). This work in the execution, but just passing the date values as aaaa/mm/dd.On my page when a pass two DateTime Parameters from two TextBox it throw "Unable to recognize the string as a valid DateTime Value"I'm using Ajax Calendar exterder on the textbox to be more specific.Here, (My Country) the format i'm using es dd/mm/aaaaAnd when i select the datepicker it comes in this format, and then a get the DateTime error type.I can get the rows in the query builder just passing the date like "2010/01/15" and "2010/01/30" for example.Hay can i force the texbox to get this format aaaa/mm/dd?

View 4 Replies

Databases :: Date Field Shows Up As Decimal, IBM AS400?

Feb 2, 2010

I am getting a DataTable from query against AS400 database. The field that clearly contains birth dates is interpreted as decimal. I am having trouble even converting it to string.

View 1 Replies

Databases :: How To Submit An Image To Oracle Blob Field

Feb 8, 2010

my goal is to save an jpeg image in a blob field in oracle. give me code in order to do this.

View 5 Replies

Databases :: Recording Individual Field Values From MySQL Database

May 3, 2010

I am using a simple Login function and need to record individual field values from MySQL database to compare with inputs.

My connection code:

Dim myConnection As MySqlConnection
Dim myDataAdapter As MySqlDataAdapter
Dim strSQL As String
myConnection = New MySqlConnection("Database=mydatabase;Data Source=xx.xxx.xx.x;port=3362;UId=myID;Password=1234;")
strSQL = "SELECT username,password FROM Login WHERE ID = '" & 1 & "'"
myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
myDataSet = New Dataset()
myDataAdapter.Fill(myDataSet,"Login")

I have confirmed it is connecting by adding the following GridView.

GridView1.DataSource = myDataSet
GridView1.DataBind()

My problem is isolating the individual field values.

View 2 Replies

Forms Data Controls :: Dropdownlist Pulls From Sql Source Into A Formview To Save To Another Table?

Feb 15, 2011

I have a dropdownlist that pulls from a datasource. When a name is selected all information drops down to a formview. Once there 3 fields get populated from the dropdownlist and then there is 2 other fields that need user input. Once they hit submit, it should write to a different table in the same DB. I cannot get the fields to populate and write to the DB. Here is my code:

[code]...

View 1 Replies

Databases :: Writing To Excel File - The Field Is Too Small To Accept The Amount Of?

Sep 23, 2010

I am writing to excel file using jet driver. If the length of value exceeds 255 characters i get the below error.'The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data'Please could you provide a solution to how can i add values with length greater than 255. Excel file is 97-2003 format.

System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand();

View 1 Replies

C# - Column Does Not Allow Nulls

Mar 14, 2011

have a look at my code below and tell me where i am going wrong.

case "particulars.aspx":
dt = JobCardManager.GetParticularsByJobId(id);
hidJobId.Value = id.ToString();
if (dt != null && dt.Rows.Count > 0)
{
gvParticulars.DataSource = dt;
gvParticulars.DataBind();
else
[code]...

View 2 Replies

Databases :: MySQL - CSharp To Assign Null Date Time To A Class Field?

Feb 21, 2011

Using MySQL 5.

In my SAP.NEt project, defined a constant:

public static DateTime NullDateTime = DateTime.MinValue;

I have a function:

protected static DateTime GetDateTime(DataRow row, string columnName)
{
return (row[columnName] != DBNull.Value) ?
Convert.ToDateTime(row[columnName]) :
Globals.NullDateTime;
}

In the source code:

public DateTime StationFeedTime{ get; set; }
StationFeedTime = GetDateTime(row, "StationFeedTime");

I ran a SQL to fetch records from MySQL, this field is Time field in MySQL.

Got an exception inside the function:

Unable to cast object of type 'System.TimeSpan' to type 'System.IConvertible'.

View 8 Replies

Databases :: Saving The Formatted Contents Of A Word File In Clob Field In Oracle?

Nov 22, 2010

Can i save the contents of a word file (which contains some formatted text) in clob field and then retrieve them in their original state i.e can i save the formatted text in clob field like we can save it in blob field?

View 1 Replies

MVC :: Handle Nulls In Views?

May 21, 2010

I have an Edit View with a bunch of fields, some non-required. If the user decides not to fill them in, thats fine and it gets saved to the database as nulls (nullable fields).

The problem is when the controller redirects to the Details page and tries to render these null objects in labels using LabelFor(Model.SomeNonRequiredField)

Where/How should i be handling "acceptable" nulls?

Right now in my service layer im manually setting these nulls to String.empty before committing to the db, but now its saving it as an empty character instead of null - something like "SetDefaultValuesForNonRequiredFields(myObject)"

View 1 Replies

WebMatrix :: PageData Passes Nulls?

Oct 26, 2010

Caller to Draw.cshtml

if (errors == false)
{
PageData["Range"] = zoom;
PageData["StartReal"] = startRe;
PageData["StartImaginary"] = startIm;
PageData["StartColor"] = startColor;
PageData["N"] = N;
PageData["SizePic"] = sizePic;
@:<img src="@Href("Draw.cshtml")" />;
}

Here all variables have a value, however when arriving in Draw.cshtml the PageData all pass as null.

Draw.cshtml
@{
var zoom = PageData["Range"];
var startRe = PageData["StartReal"];
var startIm = PageData["StartImaginary"];
var startColor = PageData["StartColor"];
var N = PageData["N"];
var sizePic = PageData["SizePic"];
Bitmap bitmap = new Bitmap(sizePic, sizePic);
Graphics g = Graphics.FromImage(bitmap);
Pen myPen = new Pen(Color.Red);
juliaset(zoom, startRe, startIm, startColor, N, sizePic, g, myPen);
Response.ContentType = "image/jpeg";
Response.AddHeader("content-disposition", "inline; filename=test.jpg");
bitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
g.Dispose();
bitmap.Dispose();
myPen.Dispose();
}

View 2 Replies

DataSource Controls :: Check For Columns With All Nulls?

Jan 5, 2010

I have a situation where a query returns ~20 columns, but at any given execution only 5 of the 20 will have non-NULL values. The remaining 15 will contain null for every row in those columns.

I need to figure out which of the 5 columns have values. I am using a SqlCommand. How would I best approach figuring out these 5 columns?

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved