|
hello, I'm quite familiar in connection and manipulation of VB and MS Access. Actually I use ADODB connection and Im using the basic database manipulation functions like MoveNext, MoveLast, Update, AddNew and something like that. Could you please help me doing it in C#? I'm really still a noob in C# specially when it comes to database. could you please teach me how to connect, add, delete, insert, filter and other basic stuffs? I would be very thankful if you'll send me a sample program with explanation. Thanks in advance!
oyams
|
|
|
|
|
You're describing ADO. ADO.NET works completely differently. There are tons of tutorials on the web, just google 'access C#'.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
oyams90 wrote: if you'll send me a sample program with explanation
Nobody here will do that, but you could find some articles here on CP or on the net I'll bet.
You would like to search on "ADO.NET", "C#" and "OleDb".
hope this helps
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
Hi
I Want Read / Add a Fonts file i.e; *.ttf to the Resource file
so that my application can read fonts file for the resx but not
from windows\fonts\
thank u
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
As far as I know the .NET framework does not have the functionality to read ttf files embedded in applications. You can however have the fonts in a local folder (relative to your application and not of the windows\fonts folder), and then use a PrivateFontCollection class to handle the fonts.
Consider looking at MSDN: http://msdn2.microsoft.com/en-us/library/ms534992.aspx[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
how to call storeprocedure in page load event
i have string strCmd = "exec rpt_OnlineStoreActivity '01/01/2000', '07/30/2007'";
can some if this is wirght away to do it.
thank you
|
|
|
|
|
may i see u'r stored procedure code?
if u use stored procedure for the query,next thing u must do is call stored procedure..or i'm missing something about your question?
for example on page load events i write this code:
string Connection = ConfigurationManager.ConnectionStrings["Connect"].ConnectionString;
SqlConnection conn = new SqlConnection (Connection);
conn.Open();
SqlCommand cmd = new SqlCommand("sp_SelectAllData", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
note : i already have a stored procedure name sp_SelectAllData in my database
but try using Data Access Layer, Bussiness Logic..so if u want some change in u'r interface u don't have much trouble to change your code
Kind Regards,
Tomi
|
|
|
|
|
I have an application which is written in C++ and consists of 5 DLLs and an EXE. In total, there's around 150-180k lines of code, so the app is far too large to simply port to .NET. Also, there are several other applications dependent on the 5 DLLS (these are also written in C++). However, I need to use some .NET components (specifically the 3rd party ASPOSE.Pdf, ASPOSE.Words, ASPOSE.Cells, and ASPOSE.Slides libraries). What is the best strategy for integrating these components into my application? Would a simple rebuild with /CLR option get me very close? (FYI: So far my .NET experience has been somewhat limited and has involved development of entire programs/websites in .NET, no need to integrate pre-existing code.)
Thanks for any advice you can offer.
|
|
|
|
|
I'd say yes. You can even built a C++/CLI dll and import it into your C++ app, making it the bridge.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
i am useing sp to collect data to gridview but it does not bind data to gridview.i can see it on page than when i debugg it does't display any thin in web site. can some one tell me what i am doing wrong?
thank you
|
|
|
|
|
Did u'r stored procedure only collect the data or there is some parameters u use?may i see u'r code please?maybe i can help u
btw u posted the message in C# forum..next time please posted u'r message to asp.net forum
Kind Regards,
Tomi
|
|
|
|
|
How do you find out the MDAC version programmically. I don't wont to hard code a specific version into the provider when I open the DbConnection.
Thanks for your help!
Lets Go, Lets hit the tape!
|
|
|
|
|
Maybe you can do so by retrieving from the registry. Just a quick thought.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
That did it! Thanks programmers!
Lets Go, Lets hit the tape!
|
|
|
|
|
I need to find out how to make it so that my program is notified whenever the user's wallpaper is changed. How do I get Windows to tell me that? (I really don't like the idea of setting a timer to check the registry every few seconds)
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
I developed a web application, which has two sections
Client Section: that is visible to local users
Control Panel: allows admin of the site to control the contents of the web application.
I created a cpanel folder on the root of the web application, and all the pages and functionality of Control Panel section goes there. The sample structure of the files is as in below section:
/Default.aspx 'Client Side File
/contactUs.aspx 'Client Side File
/Aboutus.aspx 'Client Side File
/Web.config 'Main Configuration file ( admin section uses connectionstring from
'the same web.config file
/AppCode/DAL/Classes.vb ' Contains all the classes used in both client and cpanel section
/CPanel/Default.aspx ' Admin side File
/Cpanel/UpdateContactus.aspx ' Admin Side File
/Cpanel/UpdateAboutus.aspx ' Admin Side File
Now problem is that, i need to Secure Pages in CPANEL by adding Authenticating process, now if i add the authentication information in
/Web.Config /Main configuration file
then it will apply on both client side and Cpanel side as well... but i need this authentication only in CPanel side, so what i did is add a new configuration file with appropriate instructions and a Login Page, where person trying to open CPanel will be redirected if he/she has not logged in using proper username and password.
here i added those files at place
/CPanel/Web.Config
/CPanel/Login.aspx
but when i try to open any page, it gives me an error message
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
---- The code for Web.config -----
<forms loginurl="Login.aspx" name="realestate" path="/" protection="All" timeout="30">
Any Solution?
1- Can we merge two different projects with different web.config files with each others?
:- Rashid Ali -:
|
|
|
|
|
Hi Rashid,
U should try ASP.NET Configuration. I believe U will get your answer there.
Regard,
Edwin
|
|
|
|
|
I want to be able to write data, to a file in a particular place, and read it back from that location.
The code i have below will write the data to the file with no issues, but i cant figure out how to get it to read it back. Any help is appreciated,
Thanks
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
FileStream fs = new FileStream("test.dat",FileMode.OpenOrCreate,FileAccess.ReadWrite);<br />
BinaryWriter bw = new BinaryWriter(fs);<br />
BinaryReader br = new BinaryReader(fs);<br />
<br />
bw.Seek(10,SeekOrigin.Begin);<br />
bw.Write("hello World");<br />
<br />
bw.Seek(-10, SeekOrigin.End);<br />
<br />
string myString = br.ReadString();<br />
<br />
MessageBox.Show(myString); <br />
}<br />
|
|
|
|
|
Hi,
you have confused yourself I am afraid, I'll annotate your code with
the offset each reader/writer has:
FileStream fs = new FileStream("test.dat",FileMode.OpenOrCreate,FileAccess.ReadWrite);
BinaryWriter bw = new BinaryWriter(fs);
BinaryReader br = new BinaryReader(fs);
bw.Seek(10,SeekOrigin.Begin);
bw.Write("hello World");
bw.Seek(-10, SeekOrigin.End);
string myString = br.ReadString();
In summary: you can attach as many streams as you want to a single file.
Each stream will see the same data, but have its own pointer pointing into that data.
you skipped 10 bytes (in a new file, those bytes remain filled with zeroes),
then write a string, then move somewhat back.
The reading stream has not moved yet, so it reads at position 0, and finds a lot
of zeroes, which results in an empty string.
Normally you don't jump around like that. You either write (or read) sequentially,
or you move purposely around (say to skip records you are not interested in).
Hope this helps.
|
|
|
|
|
There is only one stream, bw and br share it.
|
|
|
|
|
Of course, my mistake.
So the only problem was the last seek.
I stand corrected.
|
|
|
|
|
Instead of bw.Seek(-10, SeekOrigin.End);
I tried
bw.Seek(10,SeekOrigin.Begin);
and
bw.Seek(("hello World".Length+1)*-1, SeekOrigin.Current);
both worked
|
|
|
|
|
Thankyou both for taking the time to reply =)
|
|
|
|