ExecuteReader and output params
Hi
I am trying to run SP using ExecuteReader for SqlCommand object. SP has
Output parameters that I add to Parameters collections but it seems that
output parameter is always null. Debugging SP return not null values so it
is not a problem with SP.
Does ExecuteReader skips output parameters?
Thanks,
Shimon. Tag: Hello Tag: 65925
Excluding Noise Words from Search
How can check if a search phrase contains a noise word and let the user
about it so he/she can do search again without the noise word.
Thanks,
--
Dino Buljubasic
Software Developer
http://rivusglobal.com Tag: Hello Tag: 65923
Connection class
Hi
How can I create and call a class for a connection to my database? Code
example would be great.
Thanks
Regards Tag: Hello Tag: 65922
RowFilter - Accent Insensitive with Strings
Hello Folks!
I have a SQL Server table column and two records.
One column have "Porão" and the other "Porao".
I want filter my dataview using the RowFilter property.
example:
dv.RowFilter = "column = 'Porao'"
datagrid.datasource=dv
datagrid.databind();
I need to see two records. But i see only one because the filter use accent
sensitive when searching.
Is there a way to configure the dataset for accent sensitive?
Tks
Robson Tag: Hello Tag: 65920
Wild card search
I am trying to simulate wild card search like for example:
cran* would return any word containing 'cran' at the begining
*cran would return any word containing 'cran' at the end
*cran* would return any word containing 'cran' in the middle
Here is whay I am doing but it does not work
SELECT whatever FROM aTable WHERE this = that AND CONTAINS(aColumn,
"cran+%")
I am fetching data from an SQL Server using full text indexing
Any help will be appreciated
--
Dino Buljubasic
Software Developer
http://rivusglobal.com Tag: Hello Tag: 65918
DataBinding Dataset from a WebService
Hi, I have some problem Binding a dataSet that come from a method in a
WebService I created. My Web forms call the function from the
WebService and receive the dataSet. How can I bind this dataSet to a
dataList and some Textfields. What I want to do is select the result
in the dataList then the selected result appears in textField so I can
update those field. Does anyone have a clue?
CG Tag: Hello Tag: 65912
RowState Issue
In using a datagrid, when I modify the second row in the
grid, the first row is also taking on a rowstate of
modified, even though it has not been touched. I am sure
of this, as checking rowstate prior to modifying the
second row shows the first row to be Unchanged. Anyone
have any clues about this issue? Thanks.
JT Tag: Hello Tag: 65908
Dataset and Bindings
HI All,
1) I open up a dataset (declared at the module level)
2) I get the data with the .FILL using the DataAdapter
3) I update a DataGrid RecordSource property to the DataSource
4) I update the DataBindings of a Text box to one of those fields.
Now, the data loads into the datagrid and the text box just fine.
When I move around in the datagrid, it changes the value in the text
box.
Now, how do I change the current record using code? I've tried using
the:
me.bindingcontext(dsCustomer, "dtCustomer").position
Modifing this values does not modify the control on the screen and
changing the record position on the screen does not change the
bindingcontext.position value.
Any help is appreciated.
Dave. Tag: Hello Tag: 65907
How to Bind ListBox for Windows Form(VB.NET)
Hi,
1)I have List Box which displays all user list, When I
double click on User , I am displaying User Information on
the right hand side Text Boxes , But In Order to Retrive
the values I can't query with User Name because there are
duplicate names , So I Want to find details about the user
with his/her ID#. How would I do that when I bind the
ListBox at the FormLoad event.
2)How could I Call another form from other form by using
formname.show ( used to be in VB 6).
thanks,
Saurabh Tag: Hello Tag: 65903
DataView Filter Not working
I am using the following code to filter a DataView and then put the
dataview back into a DataSet. I've verified that strFilter contains
683 values.
The dataview initially has 1306 records before the filter. However,
the resulting dataset that comes out has all 1306 rows.
How is this possible since I'm filtering on 683 unique values?
I'd appreciate any help
-Tim
//create a dataview for the dataset
//DataTable oDT = oDS.Tables["Results"];
DataView oDV = new DataView(oDS.Tables["Results"]);
DataTable oDT = new DataTable();
try
{
if(strFilter != "")
{
//filter the dataview with the previous work ids
oDV.RowFilter = "WorkID IN (" + strFilter + ")";
}
}
catch(Exception err)
{
Response.Write("Error: " + err.Message.ToString());
}
//Convert the DataView back to a DataSet
oDT = oDV.Table.Copy();
oDS = new DataSet(oDV.Table.TableName);
oDS.Tables.Add(oDT); Tag: Hello Tag: 65902
DataAdapter update method fails
Hi.
I got a problem with the OleDbDataAdapter object in .Net.
The case is:
I fill a dataset with data from an XML-file. This works fine.
I then want to store the data into a database. This also seems to work
fine.
The problem ouccurs when I try to update the data in the table. If I
read the same XML-file into the dataset and perform the Update method
of the dataadapter it throws this Exception:
ORA-00001: unique constraint (SOME.TABLE) violated
Source code:
################################################################
Dim cb As New OleDbCommandBuilder(OleDbDataAdapter1)
DataSet1.ReadXmlSchema( _
"H:\temp\foo.xsd")
DataSet1.ReadXml( _
"H:\temp\foo.xml")
OleDbDataAdapter1.Update(DataSet1)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
################################################################
It seem to me that the dataadapter trys to do an insert and fails
because there
already is a row with the same values in the table.
Anyone got a clue how to solve this?
Lars Tag: Hello Tag: 65894
Convert Dataset to ADODB.Recordset
In order to reuse UI code in VB6 (for now) while we re-
write server components.
We want to be able to return ADODB.Recordsets from .NET
code.
This is what I have found so far
http://support.microsoft.com/?id=316337
but I was wondering if there is a better solution. Tag: Hello Tag: 65892
How to lock a table or a database using VB.NET and ADO.NET with SQL Server 2000?
Hi,
I have a few question regarding Locking question.
I'm using VB.NET and my Database is SQL Server 2000.
1) Certain part of my application, I need to lock the whole table to prevent
other user from using it, how should I lock it to prevent user access the
table.
2) There's one part of my application, I need to lock the whole database
(block user) when I want to transfer the records from the working table to
the storage table then release the lock after I'm done. How should I go
about doing it?
Regards
Vanessa Tag: Hello Tag: 65891
SqlConnection
I do an "SqlConnection" open and then a close, but the
connection to the SQL server is not released. If I do a
SP_WHO on the server I still see the connection.
How to I get the connection to drop?
Thanks
-- CWee Tag: Hello Tag: 65887
renaming an element in a schema/dataset
I read some xml data through a stream, and pass it to a dataset for it to
read. First i initialize the dataset with an xml schema.
The schema matches the data i get from the stream, but i want to change the
name of some of the columns. Normally i would add some mappings to the
dataadapter, but since i'm not using a dataadapter (there is no database
involved - i get the xml data from a webservice) i don't know how.
Is there any way you can define your schema, so it reads the correct data,
but renames the column kinda like this:
<xs:element name="date" type="xs:string" renamed-to="start-date" />
As far as i can see, there is no such attribute on the xs:element - or any
other way to do it? All i want to do, is rename the column name and still
(preferably) keep the relations to other tables/columns, without having to
loop through the dataset creating a new one with different column names.
Thanks! Tag: Hello Tag: 65881
Deserialize problem with OracleException
On August 19, 2003, a reader discovered that he couldn't
deserialize an OracleException. He began a thread with
Scot Rose of Microsoft where he described the nature of
the problem. The reader wrote,
"We have narrowed it down to the constructor
OracleException
(System.Runtime.Serialization.SerializationInfo
si,System.Runtime.Serialization.StreamingContext sc),
which looks for
members "message" and "source", but the GetObjectData
(...) method in the
base (System.Exception) uses the strings "Member"
and "Source". Since the
element lookup in SerializationInfo is case sensistive,
GetElement() and
FindElement() fail and the OracleException deserialize
throws an exception."
Scot Rose asked for a small project and the reader
provided one. There is no record of a response from MS.
So here's another project, a console app, that
demonstrates the problem. I am running framework 1.0
with a "hotfix" version of System.Data.OracleClient.dll,
version 1.0.1088.0 that fixes some of the MANY bugs in
this provider.
Can someone from MS follow-up on this bug and provide a
work-around?
Imports System.IO
Imports System.Data.OracleClient
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters.Binary
Module Module1
Sub Main()
Dim conn As New OracleConnection("Data
Source=ussxt6;User Id=foresight_mcp;Password=xxx")
Dim cmd As New OracleCommand("select * from
blah_blah", conn) ' will throw "Table or View does not
exist"
Dim reader As OracleDataReader
Try
conn.Open()
reader = cmd.ExecuteReader()
Catch e As OracleException
Dim formatter As New BinaryFormatter()
Dim stream As Stream = File.Open
("c:\temp\foo.bin", IO.FileMode.Create,
IO.FileAccess.ReadWrite)
formatter.Serialize(stream, e)
stream.Close()
stream = File.Open("c:\temp\foo.bin",
FileMode.Open, FileAccess.Read)
Try
Dim obj As Object = formatter.Deserialize
(stream)
Catch xx As Exception
MsgBox(xx.ToString())
End Try
Dim phoenix As OracleException = CType
(formatter.Deserialize(stream), OracleException)
MsgBox(phoenix.ToString())
Finally
If Not reader Is Nothing Then reader.Close()
If Not conn Is Nothing Then conn.Close()
End Try
End Sub
End Module Tag: Hello Tag: 65872
Detach SQL-Server Database from .NET
Hi,
I want to detach an SQL-Server database; what I'm doing
is this:
- Define an SQLCommand object with some SQLConnection
- Change the database context to 'master' by
setting "Database='master'" in the ConnectionString
property of the SQLConnection
- Set the CommandText of the SQLCommand object to
something like
"EXEC sp_detach_db @dbname=N'NameOfDatabaseToBeDetached'"
- Open the connection
- Call the ExecuteNonQuery() method of the SQLCommand
object.
My problem is: the database to be detached will always be
reported as currently in use (error number 3703).
Obviously, although I set the database context
to 'master' explicitly, the established connection to the
database to be detached seems to remain.
How can I break the connection to this database?
Thanks for an answer! Axel. Tag: Hello Tag: 65871
Problems with OleDbDataAdapter with parantheses
When I try to run a select through the adapter with a parantheses at
the start of the select, the adapter will not run the select, and thus
returning a empty dataset back.
e.g
(SELECT * FROM A UNION SELECT * FROM B)
UNION
(SELECT * FROM C UNION SELECT * FROM D)
Even the simplest select will fail if it starts with (.
Anyone have a solution for this problem?
I use "Provider=MSDAORA.1;Password=test;User ID=test;Data
Source=MyTestDB" as connection string
The following code
Dim objAdapter = New OleDb.OleDbDataAdapter(sPSQL, sConnection)
Dim objDataSet = New Data.DataSet()
Call objAdapter.Fill(objDataSet, coReturnValue)
I can connect to the DB and run the selects without any problems.
Thanks! Tag: Hello Tag: 65868
Typed Dataset issue, Is this a bug IN VS 2003?
I genereated typed dataset using several dataadapters in VS 2003.
Now if I go to dataset view and click on property of any col. change it
(for exsample make col. nullable) and save dataset, VB file associated
with datase is gone.
According to documentation vb file should be regenerated after each save of
the schema.
Am I doing something wrong?
Is there anyway to manually force VS generate typed dataset based on
excisted schema?
I believe I was able to change schema in VS UI and VB file got updated
automaticaly in VS 2002. Tag: Hello Tag: 65867
clob into oracle
Can any one give me an example of using the microsoft .net
managed provider for oracle to insert a clob into the
database.
We have a stored procedure which takes a clob as a
parameter, but are struggling to populate a clob type
parameter with the text we want to save. Tag: Hello Tag: 65865
Simple Timeout question
Hello,
just been trying to find the answer to what I think should be a rather
simple question but can't seem to find a definite yes or no.
Anyway question is, are asp dot net pages (aspx) subject to the same script
timeout that normal asp pages are?
IE after the default 90 seconds would the aspx through a timeout or will
they carry on until an error or the page has
finished running.
I tried the following lowering the script timeout to 30 seconds and then
adding the following line
Thread.Sleep(120000) (which should tell the thread to sleep for 2 minutes)
but it carried on till the sleep command finished and displayed the page as
normal.
If it is the case that the timeout does not apply to aspx pages, is there
some property in the web.config that can set a time
or is best practices to have something within the classes that knows when
and how to stop a particular process if it appears to be
taking to long.
are there any msdn articles that discuss these things (I haven't had much
luck so far but it is monday morning). Or is asp.net sufficiently
different to not require the web server to timout if an action takes too
long(in asp it was there to safeguard future requests from having
to wait to long).
Harry Tag: Hello Tag: 65860
A possible solution to my own question
For the public's interest :
I managed to do this by cunstructing a new DataSet , and filling it's rows
dynamically ,
then binding a DataGrid to it. When filling the DataSet , I am using my
existing DataSet
with foreach , and getting it's parent and child columns when needed.
not very efficient , but works 100%. Tag: Hello Tag: 65857
DataGrid
Is it possible to display in a data grid rows from two realted tables ?
example : Ther are two tables , ORDERS , and CUSTOMERS
Order no.| customer ID| customer name
---------------------------------------------------
4 | 4 | moshe
5 | 4 | moshe
etc... Tag: Hello Tag: 65856
Getting a Delete Command to work using Dataset & Data Adapter
I'm using an Infragistics UltraWinGrid. After deleting the ActiveRow from
the Grid, I get the following message:
----------------------------------------------------------------------------
-------------
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: Update requires a valid DeleteCommand when passed
DataRow collection with deleted rows.
----------------------------------------------------------------------------
-------------
So I attempted to manually delete the row from the data table after it was
deleted from the Grid.
dataSet_uGrid.tblItems.Rows[rowID].Delete();
dataAdapter_uGrid.Update(dataSet_uGrid, "tblItems");
But still get the same error message.
Why is this so hard to commit the Delete Command to the database??
thanks. Tag: Hello Tag: 65855
How can I add or Delete records using DataGrid and dataAdapter??
Hi,
I want to use datagrid to add/modify/delete record using datagrid.
I load some table in dataset then set datagrid.datasourse = dataset.
I tried to add record from datagrid, but it didnt work. It shows errors
that has not new added records. If I add new row into table, It shows
duplicate error.
my some code here..
dataadapter.fill(dataset, tb1)
dataGrid.dataSource = dataset.table("tb1")
then i click add button.
dataset.table("tb1").getchanges(rowstate.added)
dataAdapter.InsertCommand=("Insert into tb1 (@id,@name,@age)")
*******
I've set dataAdapter parameters and value here
*******
dataAdapter.update(dataset, "tb1")
dataset.table("tb1").acceptChange()
Thanks,
Kwok Tag: Hello Tag: 65851
Transaction State
Dear M$,
I think after paying $$$ for your products I do deserve to have the State
propery in SqlTransaction.
Please do not waste time on answering how I can overcome this limitation,
just give me the State propery.
MH Tag: Hello Tag: 65849
Copy data from DataTable to another ?
Hello,
What is the best way to create a new DataTable with
data from exists DataTable i have already in my
application ?
Thanks, Boba. Tag: Hello Tag: 65847
MS-SQL and Oracle StoredProc
In MS-SQL, when I want to use stored proc to query data out from the server
and process it in ADO.NET DataAdapter / DataReader stuff. I don't have to
bind the "out" parameter for getting the output.
However, for Oracle DBRS, I need to create an additional "Cursor" output
parameter, and I've to bind one more additional parameter. It makes my data
access layer inconsistent. I've to seperate them. Does it has a easier way
to solve this problem without duplication of my "query" codes ? Tag: Hello Tag: 65846
How can i get the size of the datatable?
Hi,All:
How can i get the size of the datatable(including data in the datatable)
in memory?
Thanks
David Tag: Hello Tag: 65843
dataadapter update
Using W2K, SQL2000, Framework 1.0 I don't understand why the corrected field
is NOT witten back to disc.
Table PERS has two coloumns: ID and data (image)
// Task: exchange first byte in field 'data' with 0x49.
Conn.Open();
SqlDataAdapter da = new SqlDataAdapter("Select * from PERS where
ID='1'",Conn);
SqlCommandBuilder myCB = new SqlCommandBuilder(da);
DataSet ds = new DataSet("PERS");
byte[] myData = new byte[5000];
da.Fill(ds,"PERS");
DataRow myRow;
myRow = ds.Tables["PERS"].Rows[0];
myData = (byte[]) myRow["data"]; // offset 0 has the correct
value
myData[0] = 0x49;
myRow["data"] = myData;
ds.Tables["PERS"].Rows[0]["data"] = myData;
da.Update(ds,"PERS");
What have I done wrong in this sniplet?
Regards,
flemming Tag: Hello Tag: 65838
Using dataset after insert, update, or delete
I'm trying to refresh a datagrid after I insert, update, or delete rows from
a DataSet. Once the database has been altered, do I need to re-query the
database?? Or is the DataSet reflective of the current state of the
database?
thanks Tag: Hello Tag: 65837
Problem writing Binary to SQL using OLE.DB. Can this be done.
Gentlemen:
I am trying to write Binary data to SQL using both
SQLClient and OleDb. SQLClient works, but OleDb fails.
When I try to update using OleDb, I get the error "Must
declare the variable '@BLOB'". But I am declaring
this "@BLOB" parameter, so why am I getting this error.
Now the same code in SQLClient works fine, and I get no
error.
Is updating binary possible with OleDb, or only in
SQLClient? Does the approach have to be altered for
OleDb? If so how?
Here is my code:
==========================================================
Dim intLength As Integer =
0 'Lenght of Blob being saved.
Dim cn As
OleDb.OleDbConnection 'Connection
Object.
Dim pParameter As New
OleDb.OleDbParameter 'If > 0, then UPDATE
succeeded.
Dim intResult As
Integer 'Add Parameters.
Dim cmdUpdateCommand As New
OleDb.OleDbCommand 'Update Command object.
Dim strUpdateCommand As
String 'Update Command.
....
'Define Connection.
intLength =
mbytPhoto.Length 'Attempt to get
length of the Blob.
strUpdateCommand = "UPDATE Employees SET Photo =
@BLOB WHERE EmployeeID = 10"
pParameter = New
OleDb.OleDbParameter 'Beginning of Parameter
pParameter.ParameterName
= "@BLOB" 'Input Parameter name.
pParameter.Direction =
ParameterDirection.Input 'Input Parameter direction.
pParameter.OleDbType =
OleDbType.Binary 'Type is binary.
pParameter.Size =
mbytPhoto.Length 'Length of Photo Blob.
pParameter.Value =
mbytPhoto 'Add Photo BLOB Parameter.
cmdUpdateCommand.Parameters.Add
(pParameter) 'Add BLOB Parameter.
cmdUpdateCommand.CommandText =
strUpdateCommand 'Define update command.
cmdUpdateCommand.CommandType = CommandType.Text
cn.Open
() 'Open a
connection.
cmdUpdateCommand.Connection =
cn 'Define connection.
Try
intResult =
cmdUpdateCommand..ExecuteNonQuery 'Update Database with
new BLOB.
Catch Bad As OleDbException
strUpdateCommand =
Bad.Message 'Error Returned: "Must
declare the variable "@BLOB" Why?
End Try
cn.Close
() 'Close the
Connection. Tag: Hello Tag: 65830
Multiple comboboxes bound to same datasource
I have multiple ComboBox controls bound to the same
DataSource (a DataSet). The DataValue and DataMember
properties are all bound to the same columns of the
DataSet. The SelectedValue properties of the ComboBoxes
are each bound to unique columns of another DataSet (a
different DataSet from the DataSource property).
When I change the value of any of the ComboBoxes (by
selecting a different item from the drop down), the value
of all up the ComboBoxes update to this newly selected
value.
How can I get rid of this behavior? I want each ComboBox
to be populated with the same data, but be able to each
have a different value selected...
Thanks,
Mike Tag: Hello Tag: 65825
Stored Procedure Parameters with oldDb
The oldDb Command does not support Named Parameters. If I am reading them
correctly, the docs say that the order of the parameter should match the
order they are declared in the Stored Procedure. When I do this the data
ends up in the wrong fields. I am using C# standard with the MSDE. If I
understand it correctly I can't use the SqlCommand because C# standard does
not allow that. It also will not work with an SQL server, only an MSDE (and
it does know the difference).
The Stored Procedure is:
INSERT INTO dbo.DemoShipments
(PTYPE, RequestDate, Company, Dept, Name, JobTitle, Phone,
Ext, Addr1, City, State, Zip, email, Source)
VALUES (@PTYPE, @RequestDate, @Company, @Dept, @Name, @JobTitle, @Phone,
@Ext, @Addr1, @City, @State, @Zip,
@Email, @Source)
private void Button1_Click(object sender, System.EventArgs e)
{
oleDbCmdAddDemoReq = new OleDbCommand("SpAddDemoReq", oleDbConDemoReq);
oleDbCmdAddDemoReq.CommandType = CommandType.StoredProcedure;
// NOTE: ORDER OF PARMS ADDS MUST MATCH ORDER OF PARMS
oleDbCmdAddDemoReq.Parameters.Add("@PTYPE", ThisType);
oleDbCmdAddDemoReq.Parameters.Add("@RequestDate", System.DateTime.Now);
oleDbCmdAddDemoReq.Parameters.Add("@Company", txtCompany.Text);
oleDbCmdAddDemoReq.Parameters.Add("@Dept", txtDept.Text);
oleDbCmdAddDemoReq.Parameters.Add("@Name", txtName.Text);
oleDbCmdAddDemoReq.Parameters.Add("@JobTitle", txtTitle.Text);
oleDbCmdAddDemoReq.Parameters.Add("@Phone", txtPhone.Text);
oleDbCmdAddDemoReq.Parameters.Add("@Ext", txtExt.Text);
oleDbCmdAddDemoReq.Parameters.Add("@Addr1", txtMailAddr.Text);
oleDbCmdAddDemoReq.Parameters.Add("@City", txtCity.Text);
oleDbCmdAddDemoReq.Parameters.Add("@State", drpState.SelectedValue);
oleDbCmdAddDemoReq.Parameters.Add("@Zip", txtZip.Text);
oleDbCmdAddDemoReq.Parameters.Add("@Email", txtEmail.Text);
oleDbCmdAddDemoReq.Parameters.Add("@Source", "Web Form");
oleDbCmdAddDemoReq.Connection.Open();
oleDbCmdAddDemoReq.ExecuteNonQuery();
oleDbCmdAddDemoReq.Connection.Close();
}
When I do this the Zip info ends up in the Source field, the State ends up
in the Zip, the City ends up in the State and the Source ends up in the City
field. Yes, I can fix this by moving the fields around but if they were not
all text fields I would have been getting odd error messages that I would
not have understood.
What am I doing wrong? Tag: Hello Tag: 65824
IDbTransaction.Dispose() behavior
Hello,
I have noticed that during Dispose() uncommitted transaction is
automatically rolled back .
This behavior is exactly what i am expecting, but I have not found any
reference in the documentation .
Can I safely rely on such behavior in my code?
Thanks in advance,
Alexander Myachin Tag: Hello Tag: 65819
Copy DataRow
After I use DataTable.ImportRow(oOtherRow);
How do I find the newly imported row in my DataTable since they neglected to
return a rowid or the DataRow form the ImportRow() method. I'm assuming that
is has to construct a new DataRow so it can set it's table property to be my
table, so the row reference I added won't be the resulting one in the
DataTable.
Tony Tag: Hello Tag: 65818
Sample Code for Forward, and Backward movement
Could someone lead me to some simple code where I can select data from an
access table via ado.net and display it in a grid for forward, and backward
movement?
Byron... Tag: Hello Tag: 65814
displaing data from a dataset in another form
Hello
Putting the myDataSet in Form2 I'd like to put a DataGrid1 in Form1 that
gets data from the myDataSet in Form2
If I select DataGrid1, selecting in the property window DataSource I can't
see myDataSet,
I know I can set that by code, but how can I do it visually?
N.B. I'm using Visual c# .net
Thanks, Peter Tag: Hello Tag: 65811
Newbie Question - DataSet/DataView (DataGrid?)
Hello , a newbie question :
Background - I am building a simple application, and since I don't have a
database server I am using XML to store the data and the DataSet.readXml()
to load and save the date. Thus I can't as far as I know use SQL commands.
(If anybody has an idea of a better way to do it , I would be VERY VERY
thankfull!!).
Question - I want to display to the user , a result query from two tables
like :
SELECT Employees.Name Bosses.ID FROM Employees, Bosses WHERE ...
But with DataView.Select() I don't know how to get data from two tables ,
and in DataGrid I also don't know how to display in the same datagrid
data from two tables...
The tables are related child->parent.
Any suggestion how can I do it?
Thanks. Tag: Hello Tag: 65805
Sub-Grid? Complicated relationships - how to proceed?
Hi,
I'm designing a web registration form used to link several related
organizations together using asp.net. I'd really appreciate some advice on
data and control structure.
I have the following data structure in my SQL database:
Users
id,user name, password, first and last name, etc.
Organization
id, org name, description, logo binary/path, etc.
Locations_Addresses
id, street address, etc.
States_Provinces
id, state_province name, abbrev, state tax code, etc.
What I need to do is associate Users.id with the Organizations.id
within the datagrid(s?), in a way that will allow users to select which org
they belong to, and also, "add" an unlisted org. In other words, I'd like to
allow for a Select DropDownList with "Other/Add" as a default, with another
textbox set for adding an unlisted org.
In order to allow for moderation, "added/suggested/registered"
organizations should remain "inactive" until reviewed and approved by an
administrator, so they would not immediately be available in the dropdown
list for other users without human interaction (admin).
In the same way, I'd like to enable this "Select or Suggest" style
interaction with my users for other fields like their Locations_Addresses,
States_Provinces, etc.
Taking the idea to completion, Suggested/Moderated field sets of this nature
should be un-editable once suggested, so that a user would need to add a new
org/location/state and suggest at the same time a cancellation of the old
data (ie address change).
Can someone please give me some guidance on how to accomplish this sort of
functionality? I'm already weeks into this form and I can finish it with
this one (although fairly complex) element.
One example of the use of this form structure is to allow a
multi-denominational church registration where members either pick a
registered denomination, and then choose from a list of associated locations
(or add one), with an associated state, or register a new denomination with
all new associated data. I'd like to avoid a separate "Add Organization"
form if possible.
I'd be glad to post my code so far if that's allowed in this group, as it's
a good (I hope) example of datagrid add new record, edit login record code.
I'd love suggestions on security, optimization, syntax, etc.
Thanks for any help!
Drew
New York Tag: Hello Tag: 65802
[BUG] OleDb driver for .NET doesn't report ordinals for PK fields correctly
When you use the GetOleDbSchemaTable() method of the OleDb connection object
with the parameter OleDbSchemaGuid.Primary_Keys and you request the primary
key fields for a table which has the primary key fields at ordinal positions
other than the first fields (for example column 3 is the primary key field),
the GetOleDbSchemaTable() method will return a set of PK fields in a
datatable but the column 'ORDINAL' in that datatable doesn't contain the
right ordinals: it always contains values which start with '1' and count up.
The ORDINAL column is therefore not usable, it doesn't reflect the correct
value. Please fix. :)
TIA
Frans Bouma
http://www.llblgen.com
--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com Tag: Hello Tag: 65800
ADO or ADO'T_Binding dataset to an array?
I have an array which has been filled from a text file and want to load
these several hundred fields into my db, which consists of 3 tables(each of
which will be receiving a portion of this data)
I also want to be able to do the reverse > load my db into an array for
processing into a report.
I've worked with several textbook examples of ADO.net programs to manipulate
data within an Access db, but I haven't found anything that covers what I am
trying to do now, other than a few hints that yes, a dataset can be bound to
an array.
Can anyone give me a hint as to how to go about doing this?
Thanks - Sean Tag: Hello Tag: 65799
select In DataSet
Hi,
I have dataset which contains the data like this
TranDate PurchaseVal
------------ -------------
2003-01-01 51
2003-01-02 52
2003-01-03 54
2003-01-04 53
2003-01-05 54
2003-01-06 56
2003-01-07 58
2003-01-08 52
2003-01-09 51
2003-01-10 55
From this data I want weekly Info
Week Value
1 208
2 ---
3 ---
How I can get this
If I am using .Select("DatePart(week,TranDate)= " & 1)
it is giving me the error DatePart is not defines
Need Advice
LIN Tag: Hello Tag: 65798
How can I delete only the elements in a joined table??
I have
Table1: CodeArticle, name, quantity
Table2: CodeArticle, date
SELECT * FROM table1,table2 WHERE table1.quantity>10
AND Table1.CodeArticle=Table2.CodeArticle
Now, I want to delete only the elements in Table2
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Hello Tag: 65797
Multi-threaded DataTable causes NullReferenceException
Hello,
I'm using a single DataTable in multi-threaded scenario. The DataTable is
not connected to any database, just created and filled in from local XML
file.
Since multiple threads can modify this single DataTable, I use C# lock
statements whenever I make changes to the DataTable, but sometimes, where
repro-steps are not exactly clear, ADO.NET causes NullReferenceException.
Here's stack trace:
at System.Data.DataTable.get_LiveIndexes()
at System.Data.DataTable.SetNewRecord(DataRow row, Int32 proposedRecord,
DataRowAction action, Boolean isInMerge)
at System.Data.DataRow.EndEdit()
at System.Data.DataRow.set_Item(DataColumn column, Object value)
I don't remember where but I remember I read notes saying ADO.NET supports
multi-thread only in DataSet/DataTable, so my understanding is that as long
as I serialize modify-operations (new, add, delete, change), it should work.
But since the exception occurs deep inside of the ADO.NET, I'm guessing this
is ADO.NET bug.
Has anyone experienced errors like this? Any pointers to workarounds are
greatly appreciated.
Note that similar errors were seen since .NET Framework 1.0, but stack
traces were different. This is from .NET Framework 1.1.
Thanks,
Koji Ishii Tag: Hello Tag: 65796
Oracle-Data not changeable in Server-Explorer
Hello,
I have a problem:
I can not change data manually in any Oracle table from
server-explorer of VStudio.NET 2003.
I always get a messagebox that says "..not changeable"
when I try to hit a key while editing a field.
The database is an Oracle 9i Win2k Server SP4.
The Client has the "Oracle Client" installed on Win2k.
I remember that earlier it was possible. But at some
point it was no more.
May be this is a special Oracle problem. But hopefully
someone can help me.
thanks Frank Tag: Hello Tag: 65795
Updating to Access
Hello,
I am new to ADO and VB.Net. I am not new to using Access. I am in the
process of creating a very large entry system for dog shows and I am having
a problem. All seems to work except one very important thing and that is
saving the actual data that has been input to the bound controls between my
Windows VB form and the actual Access table. I know that this is a very
broad and general topic, but any little information may help.
I have my ole db data adapter, my datasets in place and I have code that
reads
oledbdataadapter1.update(dsDataset1)
When this runs, no data is updated. I have read about data tables, data
views, adding rows, insert, update, delete, etc, but I am missing something
other than simply creating a data adapter, creating a dataset and then using
the data adapters update to write changed or new records back to the Access
table.
Again, thanks for any information.
Brad Tag: Hello Tag: 65793
That's kind of broad, are you having a specific problem that you could post.
It'd probably be easier to help you out that way.
Cheers,
Bill
"Yunier" <yvelazques@inf.reduc.edu.cu> wrote in message
news:06d201c37bf7$75cc7ce0$a401280a@phx.gbl...
> I need help about to use the component CrystalResport or
> Reports in C#......Yuni
"Yunier" <yvelazques@inf.reduc.edu.cu> wrote in message
news:06d201c37bf7$75cc7ce0$a401280a@phx.gbl...
> I need help about to use the component CrystalResport or
> Reports in C#......Yuni