|
I m Using .Net as Front end, in code behind i hv a datatable which has multiple rows (row count is variable),
And now i want to insert this data of datatable into database through a single SP/query..
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Use Databasename
GO
INSERT INTO tablename(Fieldname)
SELECT 'raj'
UNION ALL
SELECT 'mukesh'
UNION ALL
SELECT 'aneesh'
UNION ALL
SELECT 'pradeep'
UNION ALL
SELECT 'kishore'
GO
try this...
|
|
|
|
|
Thanks
but i can not use this type of query, because row count is variable and i want to insert all row at a time.
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
I think we can't get directly...additionally we have to use temp table like following query...
INSERT INTO mainTable SELECT * FROM tempTable;
|
|
|
|
|
Pass it as xml and use OpenXml in the stored procedure?
|
|
|
|
|
Hi
I am using an Oledb connection in my application.
My connection string is
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; datasource=C:\\Project\\DataBase.mdb");
and I am getting Oledb Exception at
OleDbDataReader dr = cmd.ExecuteReader();
What is the problem,help me
Thank u
Deepak
|
|
|
|
|
whats the command u r using
its me sid
|
|
|
|
|
Hi
This is my command
OleDbCommand cmd = new OleDbCommand("select * from Employee where EmpID=" + ListBox1.SelectedValue,con);
Thank u
Deepak
|
|
|
|
|
write this one
oledbcommand cmd = new oledbcommand("select * from employee where empid = @a",con)
cmd.parameters.addwithvalue("@a",listbox1.selectedvalue.text)
its me sid
|
|
|
|
|
Thank u! It's working
Could u explain why the previous one did not work?
Thank u
Deepak
|
|
|
|
|
see for everything there are predefined
steps
follow that
u r problem was incorrect syntax in the query.........
sindhu tiwari
(Electrical and Electronics Engineer)
its me sid
|
|
|
|
|
hi
i wanna create a table in access database with few fields
my query is
create table tab
(
name varchar(30)
)
now this is working fine
but what for a ole object
create table tab
{
photo Ole object
}
is giving error
please solve this
regards
sindhu tiwari
its me sid
|
|
|
|
|
.net expert u have not understood my problem
i know how to store a photo and retrive it my problem is creating a table
dynamically throug c# code which has a field with data type ole object
regards
sindhu tiwari
no one is expert everyone is still in learning stage
its me sid
|
|
|
|
|
HI,
My aim is to create a table in ms access database the field names,data types and the size will be given dynamically
If any one knows how to create ms access datatable please let me know
as i am struck at this position in my project
Regards
Sindhu Tiwari
its me sid
|
|
|
|
|
THANK U BHAIYA IN MEAN TIME I HAVE SOLVED THE PROBLEM
its me sid
|
|
|
|
|
Hi guys
i am using sql server as my database i want to connect it thr internet so dat i can acess it from any wear, i have an static IP also, using Static IP i can work locally but not thr internet can any one help me
|
|
|
|
|
cm pandian wrote: using Static IP i can work locally but not thr internet can any one help me
What is the error you are getting ? Have you tried pinging the machine with static IP ?
|
|
|
|
|
Sir
Used TCP/IP port 1433 in de connection string and its working only for .NET 2003, when i used de same thing in .NET 2005 it shows me an error like this
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it
|
|
|
|
|
|
Hello All,
I am using a SqlDataSource with a GridView on a ASP.NET 2005 page. I have a DropDownList (control parameter {0} ) and a TextBox (control parameter {1} ). The user picks the field they want to search in the DropDownList and then types in a search into the TextBox and it doesn't appear to like the use of LIKE in the SqlDataSource 's FilterExpression property; i.e.
SqlDataSource1.FilterExpression = "{0} LIKE '{1}'"; produces a filter that searches on EXACT MATCHes only instead of STARTS WITH like the docs say. What would be ideal for my requirements is a CONTAINS search, really. I know I could use CharIndex -- at least in an explicit WHERE clause -- however, putting FilterExpression="CharIndex('{1}',{0})>0) raises a System.Data.EvaluateException: The expression contains undefined function call CharIndex() error.
Any hints? Thanks in advance.
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
You need to use wildcard characters if you don't want to find an exact match.
The % wildcard matches zero or more characters. If you change your code to
SqlDataSource1.FilterExpression = "{0} LIKE '{1}%'";
you will get records that start with the specified sequence rather than exactly matching it.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I have the need for a database that has a large number of fields and would be accessable via ASP.NET Web page.
The table would center around locations;
Fort Worth, Topeka, etc.
Each location has up to 28 Backup Batteries that require a semi-annual inspection;
This inspection includes Voltage, Conductance, Tempreture, and Voltage with the charger off.
A number of true/false quesiton are also associated to the inspection.
Would it be best to create four tables for the Backup Batteries, another for the locations and quesitons, and then create a relationship with the Locations table for everything else?
Or would it be smarter to just create one gigantic table that has upwards of 130 columns?
Thanks,
|
|
|
|
|
Off the top of my head, the following tables should be sufficient:
1. Table to store locations
2. Table to store types of inspection check e.g. Voltage, Temperature
3. Table to store inspection questions
4. Table to store location/battery combinations
5. Table to store location/inspection instance combinations
5. Table to store location/inspection instance/battery/inspection check result combinations
6. Table to store location/inspection instance/inspection question result combinations
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi Paul, would I need to have a common Primary Key field for each one? and then would I also need to "join" them?
Thanks,
|
|
|
|
|
The primary keys for the tables would look like this:
1. LocationID
2. InspectionCheckItemID
3. InspectionQuestionID
4. LocationID | BatteryID
5. LocationID | InspectionID
6. LocationID | InspectionID | BatteryID | InspectionCheckItemID
7. LocationID | InspectionID | InspectionQuestionID
You should also consider setting up referential integrity between the primary and foreign keys in your tables to ensure the overall integrity of your data.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|